Viewing 15 posts - 16 through 30 (of 44 total)
Then maximum of the two dates should be chosen.
September 1, 2009 at 6:20 am
arun.sas (9/1/2009)
Repeated post, discussions already started in
Sorry, this actually had to be in SQL2005 forum as it used table datatype in sample query, by mistake i posted in SQL2000.
September 1, 2009 at 12:34 am
hi,
but what if all values are same and only date is diiferent for 2 rows.
then which date will be selected ?
like for example
[Code]
insert into @tbl
select 1,'R','1/1/2009',1,'A'
union
select 1,'R','1/2/2009',1,'A'
union
select 2,'M','1/1/2009',3,'A'
union
select 2,'M','1/2/2009',3,'A'
union
select 3,'N','1/3/2009',6,'A'
[/Code]
September 1, 2009 at 12:07 am
Thanks :w00t: thats what i needed
Is this magic of recursion ?
I will be very thankful if you give a brief idea of that query.
Thanks again.
August 12, 2009 at 6:39 am
Hi,
I did this,
[Code]
SELECT STUFF((SELECT ', ' + Table.ColumnName FROM Table FOR XML PATH('')),1, 1, '') AS CSVColumn
[/Code]
July 1, 2009 at 7:03 am
Hi,
I used the normalized design for my case.
If i want my output to be in this form for a student then?
Name SelectedSubjects
--------------------------
A Maths,History,Drama
B ...
July 1, 2009 at 3:00 am
Hi,
So i will have 3tables. viz.
1) tbl_Names : All students names (with a unique id nId).
2) tbl_AllSubjects : A pool to have all the subjects from where students can choose...
June 30, 2009 at 10:07 am
Thanks a lot friends !! it helped me a lot !
June 25, 2009 at 5:09 am
Pandian S (6/25/2009)
[font="Courier New"]DECLARE @s-2 VARCHAR(500)DECLARE @X XML
SELECT @s-2='1,2,3,4,5'
SELECT @X = '<Data>' + REPLACE(@S,',','</Data><Data>') + '</Data>'
SELECT N.value('.','varchar(max)') 'Result' from @X.nodes('Data') as T(N)[/font]
Hi,This one takes a string...
June 25, 2009 at 3:34 am
arun.sas (6/25/2009)
descentflower (6/25/2009)
csv values in rows without using a while loop
Hi,
try this
--create table #temp (name1 varchar(5))
declare @s-2 varchar(500)
set @s-2='1,2,3,4,5'
select @s-2 = 'select ''' +...
June 25, 2009 at 3:10 am
Thats amazing thank you so much !! :w00t:
Anything to take care using
June 25, 2009 at 2:41 am
Thanks again ... i am a newbie so few doubts are still there !
June 24, 2009 at 6:57 am
Sorry, but if i use any random integer like 89 then this also works ?
June 24, 2009 at 6:41 am
Is it always needed to write 0 and 1 in the case.
What does 0 and 1 refer here?
does select becomes " select t from @t order by 1,t" at...
June 24, 2009 at 6:26 am
Viewing 15 posts - 16 through 30 (of 44 total)