| Author: karthik 16 May 2008 | Member Level: Diamond Points : 2 |
--- selecting 5 th highest value from the table
SELECT TOP 1 id FROM (SELECT TOP 5 id FROM tableA ORDER BY id ASC) top5 ORDER BY id DESC
|
| Author: karthik 16 May 2008 | Member Level: Diamond Points : 2 |
Get the count of columns in table
select count(name) from syscolumns where id=(select from sysobjects where name='tablename')
|