ArthurXF从业10年的CTO,受上海非凡学院邀请,进行PHP,CSS,FREEBSD等网络技能授课培训,有意向参加的,请联系.
select的嵌套用法:
引用
select A from (select * from tableB) as t1
或者
select A from (select * from tableB) t1

例子:
引用
SELECT *
FROM (
SELECT *
FROM affiche
ORDER BY `submit_date` DESC
) AS t1
GROUP BY type_id
ORDER BY `submit_date` DESC
LIMIT 0 , 30


如果要从表userinfo(此表也含有userid)中选出与表result的userid不同的所有数据,例子如下:
引用
select * from userinfo where userinfo.userid not in(select result.userid from result)
Tags: , ,
分页: 1/1 第一页 1 最后页 [ 显示模式: 摘要 | 列表 ]