三种数据库取前n条记录的方法

imhui posted @ 2010年4月11日 21:37 in SQL , 921 阅读

MySql取前十条记录

select t.* from tableName t where limit 10
或  
select t.* from tableName t where limit 0 to 1

 

sql server 取前十条记录

select top 10 t.* from tableName t

oracle取前十条记录

select rownum,t.* from tableName t where num <=10


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter