数据库
biange2019
不放弃,坚持学习
展开
-
MySQL在字段中使用select子查询
MySQL在字段中使用select子查询 http://blog.csdn.net/kankan231/article/details/47336733 前几天看别人的代码中看到在字段中使用select子查询的方法,第一次见这种写法,然后研究了一下,记录下来 大概的形式是这样的: select a .*,(select b.another_field from b where a.id转载 2017-04-19 21:07:55 · 2156 阅读 · 0 评论 -
SQL选出最受欢迎的
http://bbs.csdn.net/topics/392013038 create table TCustomer(cid integer primary key, name varchar2(20), age integer); -- // 客户表: 主键, 名字,年龄 create table TBook(bid integer primary key, name varchar2转载 2017-04-19 18:59:59 · 1589 阅读 · 0 评论 -
sql语句
查询重复数据,用语句: select id,name from test group by id,name having count(*)>1; 删除重复记录用语句: delete from test where rowid not in (select min(rowid) from test group by id,name); commit; 选出大于平均值的所原创 2017-07-17 00:11:28 · 235 阅读 · 0 评论