我想要使用單個查詢來自所有表的數據。我怎麼可以從該表中獲取數據有效如何從多個表中有效地獲取數據?
下面是我的預期輸出:
我已經試過這樣的次給錯誤。
select b_id,
b_datetime,
invoice_id,
plan_id,
exp_datetime,
plan_name,
plan_amount,
months,
s_name,
s_url,
name
amount
from tblplanboughts pb,tblplans p , tblshops s , tblusers u
where pb.uid=u.uid &&
pb.plan_id=p.plan_id && u.uid=s.uid;
您現在如何創建輸出?你有什麼嘗試?什麼部分不起作用? Google sql加入。 – 2014-08-28 11:39:06
@a_horse_with_no_name,在MySQL中我們可以使用['AND'和'&&'](http://dev.mysql.com/doc/refman/5.0/en/logical-operators.html#operator_and).. :) – 2014-08-28 12:00:25
@a_horse_with_no_name,我沒有深入的知識,但是我嘗試了它的工作! :D – 2014-08-28 13:59:35