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 )!