« first day (4 days earlier)      last day (640 days later) » 

22:40
@RubberDuck @Phrancis
@Malachi Yo
I have a Category Column I want it Alphabetical
but I have a miscellaneous category that I probably want at the end, how can I do that in a query?
Misc category need to be sorted too, or?
OH nevermind
Hold on, easy stuff
I am currently sorting on the description as well
the categories get turned into tabs and then the descriptions get listed under the tabs, but the code is already set up to read from the one query
SELECT
	Category,
	-- other stuff
FROM YourTable
WHERE Category <> 'Misc Category'
ORDER BY Category ASC

UNION

SELECT
	Category,
	-- other stuff
FROM YourTable
WHERE Category = 'Misc Category'
22:44
lol
maybe not
SQL HELPLINE ?!?!
hahaha... never knew there is such a thing existed
You could do a UNION in your CTE, if need be and you need to do more complicated stuff
Hey @Phrancis. Now I know where you were hiding. :D
Bah, I'm only in 5 chat rooms pretty much all the time ;-)
3
22:46
Do you let @Phrancis-bot answer the question when you go to bed? :D
Sorry for the non-related entry though. :) Just thought I'll stop by and say hi.
@Mehrad You go to bed...?
2
BLEH sticking to union.... I have never done it before!
Basically you can copy-paste your code before + after the UNION and just change the WHERE condition to include instead of exclude your special categories
UNION ALL is also faster, although that will leave duplicates in, if there are any
it won't let me order by
o.O
Syntax error, or just not working?
22:58
depending on where I put the first Order by, gives me either a Syntax error near UNION
or
incorrect syntax near 'order'. Expecting ')', UNION, or EXCEPT
maybe I should try without parenthesis?
still incorrect near union
Can you post a snippet (mostly what's just before and after UNION)?
select uCode.CodeID as "EventID",
		uCode.Description as "EventName",
		uCaseEventType.BaseEventTypeKey as "BaseTypeKey",
		LTRIM(RTRIM(sEventType.Description)) as "BaseTypeDesc"
		, LTRIM(RTRIM(uCodeGroup.Description)) AS "EventGroup"
	from Justice.dbo.uCaseEventType AS uCaseEventType
       inner join Justice.dbo.uCode AS uCode on uCode.CodeID = uCaseEventType.CaseEventTypeID
       INNER JOIN Justice.dbo.xuEventTypeNodeGroup AS xuETNG ON uCaseEventType.CaseEventTypeID = xuETNG.CaseEventTypeID
some characters don't transfer well during copy/pasta
Try UNION ALL maybe?
Try removing parentheses in both of these:
	where (uCode.ObsoleteDate is null
			or uCode.ObsoleteDate > getdate())
Only other thing I can think of is try removing LTRIM and RTRIM on both the 'Miscellaneous' where clauses
Gotta go home, do let me know if you figure it out, I'd be curious. Never had any problems with UNION personally, as long as the column names and data types in the "SELECT" are the same...
23:13
Wait. What's going on @Malachi?
Oh! How about something like this.
SELECT *,
    Case category
    When `Misc` Then 1
    Else 0
END as sortfield
FROM table
ORDER BY sortfield, category
Sorry for the awful formatting. On my mobile.
Actually, I don't think you even have to select the value. I think you can put the case in the order by.
LET ME SEE HERE
oops
it doesn't like the Syntax for the Case Statement in the SELECT for some reason..... give me a second to figure out how to make this work with my query
0
Q: Why don't SQL stored procedures parse image path strings?

Shortstuff81000I am creating a cheat/fan page for Doodle Creatures. I have gotten the page to work, but I am using inline SQL instead of stored procedures. I have tried making my Select statements stored procedures, but the image info doesn't get parsed correctly. Here is my SQL data source using the stored pr...

23:38
@RubberDuck I fixed it, I might even post for review
maybe not. the table names are not very fun

« first day (4 days earlier)      last day (640 days later) »