mysql多表關聯查詢報了下面的錯誤:
Column ‘merchant_code’ in where clause is ambiguous
這是因爲關聯查詢的多個表都有同一個字段名,需要加上表限定
如:
select a.name from table a,table b where a.ref_id=b.id and b.name=‘XXX’
mysql多表關聯查詢報了下面的錯誤:
Column ‘merchant_code’ in where clause is ambiguous
這是因爲關聯查詢的多個表都有同一個字段名,需要加上表限定
如:
select a.name from table a,table b where a.ref_id=b.id and b.name=‘XXX’