我是新來的sql/phpmyadmin和我有這個問題。問題與查詢phpmyadmin
SELECT `2.checkNumber`,`1.customerName'
FROM
`classicmodels1` AS 1,
`classicmodels2` AS 2
WHERE `1.customerNumber`=`2.customerNumber`
我是新來的sql/phpmyadmin和我有這個問題。問題與查詢phpmyadmin
SELECT `2.checkNumber`,`1.customerName'
FROM
`classicmodels1` AS 1,
`classicmodels2` AS 2
WHERE `1.customerNumber`=`2.customerNumber`
替換:
`1.customerName'
與
`1.customerName`
甚至更好改寫避免使用引號。此外,我會用「T1」和「T2」取代別名「1」和「2」:
SELECT t2.checkNumber,t1.customerName
FROM
classicmodels1 AS t1,
classicmodels2 AS t2
WHERE t1.customerNumber=t2.customerNumber
我仍然收到「#1046 - 沒有選擇數據庫」的錯誤。感謝您的幫助。 – user678502 2011-03-27 16:38:39
@user您需要在phpMyAdmin中選擇一個數據庫,然後才能運行該查詢。應該有一個列表在左邊 – 2011-03-27 16:46:52
嗨,我現在得到這個錯誤#1146 - 表'classicmodels2.classicmodels1'不存在與此查詢SELECT't2.payments.checkNumber','t1.customers.customerName ' FROM 'classicmodels1' AS t1, 'classicmodels2' AS t2 WHERE't1.customers.customerName' ='t2.payments.checkNumber' – user678502 2011-03-28 00:40:37
您應該添加什麼樣的問題。雖然在這種情況下,我確信它是數字表別名。嘗試't1'而不是'1' – 2011-03-27 08:39:53
我仍然收到一個錯誤,說「#1046 - 沒有選擇數據庫」。感謝您的幫助。 – user678502 2011-03-27 16:43:37