sql语句
博客专区 > _______- 的博客 > 博客详情
sql语句
_______- 发表于1年前
sql语句
  • 发表于 1年前
  • 阅读 0
  • 收藏 0
  • 点赞 0
  • 评论 1

腾讯云 技术升级10大核心产品年终让利>>>   

(8)SELECT (9)DISTINCT  (11)<Top Num> <select list>
(1)FROM [left_table]
(3)<join_type> JOIN <right_table>
(2)ON <join_condition>
(4)WHERE <where_condition>
(5)GROUP BY <group_by_list>
(6)WITH <CUBE | RollUP>
(7)HAVING <having_condition>
(10)ORDER BY <order_by_list>


select * from (select A.*,rownum row from(select * from table_name) A where row<10) where row>=0

select * from table_name order by time limit 0,10

select a.* from xlj_test a inner join (select name , max(version) version from xlj_test group by name) b on a.name = b.name and a.version = b.version order by a.name 

select (select table1.id from xlj_test table1 where table1.name = K.name AND table1.version = K.version) id,name,version  from (select table2.name NAME,max(table2.version) version from xlj_test table2 group by table2.name)  K

--oracle
SELECT * FROM xlj_test WHERE ROWNUM <= 5
--mysql
SELECT * FROM xlj_test LIMIT 10


CASE sex
WHEN '1' THEN '男'
WHEN '2' THEN '女'
ELSE '其他' END

共有 人打赏支持
粉丝 4
博文 71
码字总数 34890
评论 (1)
_______-
查询空表
select table_name,num_rows from user_tables where num_rows=0;
×
_______-
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
* 金额(元)
¥1 ¥5 ¥10 ¥20 其他金额
打赏人
留言
* 支付类型
微信扫码支付
打赏金额:
已支付成功
打赏金额: