Viewing 5 posts - 151 through 155 (of 155 total)
Adrian,
Your solution would be more elegant indeed, but it doesn't work.
Unfortunately, the TOP keyword accepts only a constant, not a variable.
Dinesh,
Indeed, I would not add an index to a Qty...
November 21, 2003 at 8:28 am
Here are two shorter queries that do the same thing as your queries:
select distinct (select count(distinct number) from nMaxMin s2 where
s2.number<=s1.number) as rank, number from nMaxMin s1 order by 1
select...
November 21, 2003 at 2:41 am
Here is one using only DAY(), MONTH() AND YEAR() functions:
SELECT * FROM MyTest WHERE
year(@today)=year(@lastday) and month(@today)<month(@lastday) and
( month(birthday)>month(@today) and month(birthday)<month(@lastday)
or month(birthday)=month(@today) and day(birthday)>=day(@today)
or month(birthday)=month(@lastday)...
November 11, 2003 at 1:49 am
quote:
Great article. One disadvantage to a clustered index that I hear a lot of people claim is disk space. How...
October 8, 2003 at 3:20 am
quote:
However, if you use the function:[...]
And then the select:
select * from lef(123456,123456,'LUN')
It uses the same index as the first...
October 1, 2003 at 1:10 am
Viewing 5 posts - 151 through 155 (of 155 total)