SELECT append.p_id,contract.contract_num ,contract.date_con_up,contract.contract_name ,contract.contract_file, append.date_app_up,append.append_name,append.append_file,contract.con_description FROM contract LEFT JOIN append ON contract .contract_id= append.contract_id;
SELECT append.p_id,contract.contract_num ,contract.date_con_up,contract.contract_name ,contract.contract_file, append.date_app_up,append.append_name,append.append_file,contract.con_description FROM contract LEFT JOIN append ON contract .contract_id= append.contract_id;
SELECT append.p_id,contract.contract_num ,contract.date_con_up,contract.contract_name ,contract.contract_file, append.date_app_up,append.append_name,append.append_file,contract.con_description
FROM contract
LEFT JOIN append ON contract .contract_id= append.contract_id
WHERE con_description LIKE '%a*%' OR p_id LIKE '%*%'
SELECT append.p_id,contract.contract_num ,contract.date_con_up,contract.contract_name ,contract.contract_file, append.date_app_up,append.append_name,append.append_file,contract.con_description
FROM contract
LEFT JOIN append ON contract .contract_id= append.contract_id
WHERE contract.con_description LIKE '%a*%' OR append.p_id LIKE '%*%'
SELECT append.p_id,contract.contract_num ,contract.date_con_up,contract.contract_name ,contract.contract_file, append.date_app_up,append.append_name,append.append_file,contract.con_description
FROM contract
LEFT JOIN append ON contract .contract_id= append.contract_id
WHERE con_description LIKE 't%' OR p_id LIKE '1'
มันขึ้นแบบนี้ค่ะ #1052 - Column 'p_id' in where clause is ambiguous
แต่ถ้าใส่ชื่อตารางให้มัน
SELECT append.p_id,contract.contract_num ,contract.date_con_up,contract.contract_name ,contract.contract_file, append.date_app_up,append.append_name,append.append_file,contract.con_description
FROM contract
LEFT JOIN append ON contract .contract_id= append.contract_id WHERE contract.con_description LIKE 't%' OR append.p_id LIKE '1'