SQL语句(几张表在一起联合查询,获取第几条到第十几条数据)
程序员文章站
2022-05-02 21:45:25
...
SQL语句(几张表在一起联合查询,获取第几条到第十几条数据):
1.如分别有A,B,C,D四张表,A,B,C,D关联在一起如:((A Inner join B By A.Id =B.AId) Inner join C By B.Id =C.BId)Inner join D By C.Id =D.CId Where 条件一 AND 条件二... ;
上面按照时间排序。从中获取第11条到第20条数据。sql语句应该怎么写?
回复内容:
1.如分别有A,B,C,D四张表,A,B,C,D关联在一起如:((A Inner join B By A.Id =B.AId) Inner join C By B.Id =C.BId)Inner join D By C.Id =D.CId Where 条件一 AND 条件二... ;
上面按照时间排序。从中获取第11条到第20条数据。sql语句应该怎么写?
MySQL:
select * from (select ... from ((A Inner join B By A.Id =B.AId) Inner join C By B.Id =C.BId)Inner join D By C.Id =D.CId Where 条件一 AND 条件二... ) as table LIMIT 11,10
以上就是SQL语句(几张表在一起联合查询,获取第几条到第十几条数据)的内容,更多相关内容请关注PHP中文网(www.php.cn)!