1. select top 15 * from yourtable order by id 2. select * from yourtable where yourcol like 'w%'
到底是行还是列? 如果是30行,要查询前15行,则应该是 select top 15 * from yourtable order by id 否则 1. select colum1,colum2,.......from yourtable 2. select * from yourtable where yourcol like 'w%'
1.只能 select col1,col2,...,col15 from table 2.因列名不能直接用变量表示,只能执行字符串
select top 15 * from yourtable order by id
2.
select * from yourtable where yourcol like 'w%'
如果是30行,要查询前15行,则应该是
select top 15 * from yourtable order by id
否则
1.
select colum1,colum2,.......from yourtable
2.
select * from yourtable where yourcol like 'w%'
select col1,col2,...,col15 from table
2.因列名不能直接用变量表示,只能执行字符串