Viewing 5 posts - 1 through 6 (of 6 total)
SELECT a.stname, a.score FROM student a WHERE (SELECT COUNT (DISTINCT (b.score)) FROM student b WHERE a.score<=b.score) BETWEEN 1 AND 5
ORDER BY a.score DESC
I think this is the required solution.
October 10, 2005 at 11:14 pm
hi,
replace function works in your case. May be your criteria is not satisfying to get the records to be updated.
create table #temp
(cntry varchar(12))
insert into #temp
values ('F R A N C E')
select...
September 23, 2005 at 5:21 am
Uninstall SQL Server by using the Add/Remove Programs applet in Control Panel. After you remove SQL Server from the computer, Microsoft recommends that you restart your computer to remove files...
September 12, 2005 at 3:59 am
U can add spaces to string by enclosing the spaces in the two single quotes. For eg
declare @str1 varchar(10)
set @str1 = 'abcdef'
select @str1 +' '+ 'ghi'
the spaces in the...
August 19, 2005 at 12:37 am
Declare the @Dy variable as Varchar(12) instead of Varchar only.
when you declare @Dy Varchar it takes only the first character of the string assigned to it. For example
Decalre @Dy varchar
set...
August 9, 2005 at 4:15 am
Viewing 5 posts - 1 through 6 (of 6 total)