手動,我有這樣的查詢我的sql:你的SQL語法有錯誤;檢查對應於你的MySQL服務器版本正確的語法使用近'
select c.*,j.pict
from mst020 a
inner join mst022 c on c.mst020_id = a.id
left join (select e.pict as pict from mst021 e
where e.line_number =
(select max(f.line_number) from mst021 f where f.mst020_id = a.id)
and e.mst020_id = a.id) j
但是當我處理該查詢,,錯誤顯示:
你的SQL語法有錯誤;檢查對應於你的MySQL服務器版本的在線使用近「」 5
我試圖因爲甲骨文學會我的SQL它不是problme當G有子查詢像that.thx正確的語法手冊
派生表必須haave一個別名:(從mst021 E選擇e.pict爲PICT其中e.line_number =(從mst021 f選擇最大值(f.line_number)其中f.mst020_id = a.id)* * AS tmp ** –
您需要在'left join'後使用表格 – Alex
嗯我已經嘗試過,但仍然錯誤.. –