内部联系&工会没有工作

时间:2014-02-14 03:19:19

标签: mysql inner-join union combinations

我想问一下我的脚本无效。

SELECT A.*,B.mat_nama,C.mats_nama 
FROM pengeluaran AS A 
INNER JOIN(material AS B) ON(A.mat_id = B.mat_id) 
INNER JOIN(mat_satuan AS C) ON(B.mat_satuan_id = C.mats_id)
WHERE A.mat_id = '7'
   AND A.pengeluaran_tgl BETWEEN '01/01/2014'  AND '02/28/2014'

UNION

SELECT A.*,B.mat_nama,C.mats_nama
FROM penerimaan_sub AS A 
INNER JOIN(material AS B) ON(A.mat_id = B.mat_id)
INNER JOIN(mat_satuan AS C) ON(B.mat_satuan_id = C.mats_id)
WHERE A.mat_id = '7'
  AND A.penerimaan_tgl BETWEEN '01/01/2014' AND '02/28/2014'
Error Notification in PhpMyadmin:

1064 - 您的SQL语法出错;查看与您的MySQL服务器版本对应的手册,以便在'ON(A.mat_id = B.mat_id)INNER JOIN(mat_satuan AS C)ON附近使用正确的语法(B.mat_satuan_id = C.mats_'在第1行

0 个答案:

没有答案