2013-11-24 55 views
0

我怎麼能在postgres中工作?選擇與極限,偏移和地點條件

SELECT * 
    FROM ITEM I 
LIMIT 10 OFFSET 0, ITEM_TYPE ITP 
WHERE ITP.tp_item = I.tp_item 
    AND ORDER BY id_item 

我懷疑我會做一個子查詢,但我的嘗試均以失敗告終:(

+0

您的SQL不完整。AND ORDER BY BY' –

回答

0

你試圖做類似下面?

select * 
from item i 
inner join item_type itp on itp.tp_item = i.tp_item 
order by id_item 
offset 0 
limit 10; 

SELECTdocumentation給出了一個語法優秀概述