Viewing 15 posts - 556 through 570 (of 898 total)
Please don't create duplicate threads for the same issue. This will fragment the replies.
Original Thread: http://www.sqlservercentral.com/Forums/Topic1287441-392-1.aspx
April 20, 2012 at 11:48 pm
You can add one more column "rownodesc" similar to "rowno" with ORDER BY option as "testCol DESC"
SELECT*,
CASE
WHEN a.rowno>1 AND a.rownodesc = 1 THEN 'Last'
THEN a.rowno>1 THEN 'DUP'
ELSE 'First' END AS...
April 20, 2012 at 11:45 pm
Is this an Interview/Homework question?
Share what you have tried so far.
We will help you out from wherever you are stuck.
This will help you learn better.
April 20, 2012 at 11:07 pm
Yes. This is the correct place to ask T-SQL questions related to SQL Server 2008.
Welcome to SSC 🙂
April 20, 2012 at 11:01 pm
Glad you could solve the issue yourself 🙂
You will learn a few more things if you check the link I referred to in my earlier post
April 19, 2012 at 7:24 am
This should help you out for time-being.
I think there was a similar post even earlier which had more than one solution, will check and re-post if I get it.
DECLARE @files...
April 19, 2012 at 6:25 am
Good Question. Made me think a lot.
Though I knew the existence of WITH TIES option, I never really used it and never bothered to get the exact details of how...
April 13, 2012 at 12:11 am
Annee (3/21/2012)
'An explicit value for the identity column in table 'DGSData.dbo.DocumentHoldBackup' can only be specified when a column...
March 22, 2012 at 4:12 am
Bhuvnesh (3/20/2012)
i liked you reply it helped me but one doubt ?
do we really need
case when c.name LIKE '%[0-9]' then '' else c.name end -- needed to sort...
March 20, 2012 at 2:23 am
Hope this helps
declare @t table (name nvarchar(50))
insert into @t
select 'count_1'
union select 'acct_id'
union select 'count_19'
union select 'count_2'
union select 'count_29'
union select 'count_3'
union select 'count_30'
union select 'count_100'
union select 'count_stub'
union select 'prod_count_stub'
union select 'count_id'
union...
March 20, 2012 at 12:20 am
Not sure what you need exactly. Can you post the expected result based on your updated sample data above.
March 19, 2012 at 11:56 pm
Jeff Moden (3/16/2012)
er.sivaganesh (3/16/2012)
March 17, 2012 at 12:40 am
jean 93062 (3/12/2012)
March 12, 2012 at 9:01 am
You can also have a look at the book mentioned in the below link
Mastering SQL Server Profiler - Brad McGehee
March 5, 2012 at 4:09 am
You can solve the problem by using a CROSS TAB or PIVOT
http://www.sqlservercentral.com/articles/T-SQL/63681/ - Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
http://www.sqlservercentral.com/articles/Crosstab/65048/ - Cross Tabs and Pivots, Part...
January 24, 2012 at 5:33 am
Viewing 15 posts - 556 through 570 (of 898 total)