Viewing 15 posts - 61 through 75 (of 90 total)
Hey Matt,
Nice solution! A buddy of mine has turned me onto the row_number (), and I've been trying to incorporate it more into my code. I
cdun~ you're welcome......
February 27, 2008 at 9:11 am
It is much easier to help if you post code to create and populate a temp table with sample data, and what you are looking for logically from the resultset.
I...
February 26, 2008 at 5:14 pm
Another way to skin the cat is a HAVING clause (basically filtering your GROUP BY)...
HAVING Count(tc) = (subquery)
February 26, 2008 at 3:47 pm
How about adding a TOP (1) clause to the SELECT and an ORDER BY COUNT (tc) DESC ?
February 26, 2008 at 3:44 pm
Thank you sir... I figured it was somewhere easy.
Thanks for taking the time to respond.
February 19, 2008 at 9:00 am
Congrats fizzleme!
Good feeling, huh? Whew!
Keep it up...
January 31, 2008 at 4:36 pm
That seems like another good way to skin the cat, and very lightweight. I think I like that solution better than a continuously running Profiler Trace. However, the...
January 15, 2008 at 2:46 pm
Have you investigated login triggers and if they will work for your needs? In SQL 2005 you can audit logon events and store that data in a table and...
January 15, 2008 at 2:02 pm
Hi Nita,
It is a dilemna.
I have had that need too, and am concerned that running a trace against our server would be too resource intensive. We have over 200...
January 15, 2008 at 11:50 am
Hi Duran,
I am a pretty big fan of Transcender. Since I started taking tests, it just seems to match my way of thinking. Seems like they cover all...
December 4, 2007 at 9:46 am
One question I have, that I haven't been able to figure out... how do you post your code in the little blue box? When I copy and paste right...
November 27, 2007 at 11:03 am
Jason... that is brilliant! You have no idea how long I spent trying to substring, charindex... what a mess.
November 21, 2007 at 11:34 am
Sorry formatting got messed up... maybe this is easier to read:
SELECT
ROW_NUMBER()OVER(ORDER BY t1.client_id, t1.date1) as stay_no,
t1.client_id,
t1.id as admit_id,
t2.id as discharge_id,
t1.date1 as admit_date,
t2.date1 as discharge_date
...
November 21, 2007 at 11:05 am
Try this out... self join to connect client_ids... first table admit, second table discharge, subquery on second to select top date that is bigger than admit date.
SELECT
ROW_NUMBER()OVER(ORDER BY t1.client_id, t1.date1)...
November 21, 2007 at 10:56 am
We are using this to create a nice name for our backups, but I'm looking for code to delete files after a certain day too. Maintenance plans always seem...
November 9, 2007 at 11:34 am
Viewing 15 posts - 61 through 75 (of 90 total)