If u wanna display the particular column value in one row with Comma separated
The idea behind of that is only depends on self join
DECLARE @str VARCHAR(8000)
SELECT @str = COALESCE(@str+',','')+(SELECT UserID FROM UserMaster UM1 WHERE UM1.UserPKID = UM2.UserPKID ) FROM usermaster UM2
SELECT @str
The Result like this
------------------------
SHANKAR,HARI,SELVAM,RAMESH,DHINA,ASIF,RAJESH,SIVA,AMBRISH,RAMU
Thursday, March 17, 2005
Tuesday, March 15, 2005
Data Base -SQL Server
To find out 5 th Maximum Salary
select top 1 max(sal) from salary where
sal not in (select top 4 max(sal) from salary group by sal order by sal desc )
To find out 5 th value from Top
select top 1 * from salary where sal not in (select top 4 sal from salary )
select top 1 max(sal) from salary where
sal not in (select top 4 max(sal) from salary group by sal order by sal desc )
To find out 5 th value from Top
select top 1 * from salary where sal not in (select top 4 sal from salary )
Friday, February 18, 2005
Alter table
// Modify the column datatype
alter table sam
alter column hi int
//Add new column
alter table sam
add age int
alter table sam
alter column hi int
//Add new column
alter table sam
add age int
Wednesday, February 16, 2005
Modify Column name
Modify the Column name in Sql server
sp_rename 'TableName.[OldColumn]','NewColumn','COLUMN'
sp_rename 'TableName.[OldColumn]','NewColumn','COLUMN'
Saturday, January 22, 2005
Dot Net
http://support.microsoft.com/default.aspx?scid=kb;en-us;308448
http://www.objectinnovations.com/CourseOutlines/423.html
http://www.dotnetjohn.com/articles.aspx?articleid=32
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/httpcomm.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/httpcomm.asp
http://www.metabuilders.com/Tools/OneClick.aspx
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsmtphn2k3/html/Smartphone_2003.asp
http://www.objectinnovations.com/CourseOutlines/423.html
http://www.dotnetjohn.com/articles.aspx?articleid=32
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/httpcomm.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/httpcomm.asp
http://www.metabuilders.com/Tools/OneClick.aspx
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsmtphn2k3/html/Smartphone_2003.asp
Friday, November 26, 2004
Tuesday, November 23, 2004
Tuesday, November 09, 2004
Wednesday, October 20, 2004
Friday, October 08, 2004
Thursday, September 09, 2004
Saturday, July 31, 2004
Monday, July 26, 2004
Friday, July 23, 2004
Subscribe to:
Posts (Atom)

