我有一个 PHP 代码可以从多个表中检索数据,例如:
SELECT RC.customer_id, RC.customer_number, RAA.address_id, RAA.customer_id FROM apps.RA_CUSTOMERS RC, apps.RA_ADDRESSES_ALL RAA WHERE RC.customer_number = 89
但是,由于 customer_id 位于两个单独的表中,我该如何检索它?对于其他一切,在 while() 循环中,我可以做
while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
$row['CUSTOMER_NUMBER']; //this works!
$row['RC.CUSTOMER_ID']; //this does not ...
$row['CUSTOMER_ID']; //this works, but how do I know which table is this from?
}
非常感谢任何帮助!