RE: How to deal with all foreign keys?
| From: | Wee Chua | Date: | Mon, 16 Oct 2000 18:46:19 +0000 |
| Subject: | RE: How to deal with all foreign keys? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-20417@lists.php.net to get a copy of this message | ||
Hi ron,
Are you saying that is impossible to update the row in the result set
(virtual table) even if it has serveral different primary keys in it?
Calvin
-----Original Message-----
From: Ron Johnson, Jr. [mailto:ron.l.johnson@home.com]
Sent: Monday, October 16, 2000 2:23 PM
To: mysql@lists.mysql.com
Subject: Re: How to deal with all foreign keys?
Wee Chua wrote:
>
> Hi all,
> Does anyone know the way to update, delete or edit the query after the
left
> join statement? How could I find out what data belongs to what table? What
> is the primary key of the row iin the what table n the result set? I don't
> have any ideas this thing could work after complex left outer join? Please
> help, thanks a lot!
>
> Select ProjectName,
> Company.Name,ProjCompanyType.Type, ProjCompany.ContractCost,
> Phone.Area_Code, Phone.Phone_Number as 'Phone', PhoneType.Type from
Project
> LEFT JOIN ProjCompany on Project_ID=FKProject_ID left join Company on
> ProjCompany.FKCompany_ID=Company_ID left join ProjCompanyType on
> FKProjCompanyType_ID=
> ProjCompanyType_ID left join Phone on Company_ID=Phone.FKCompany_ID left
> join PhoneType on Phone.FKPhoneType_ID=PhoneType_ID
There is no PK in the result set, since it is just a "virtual
table". Once you fetch a row, you must then update individual
tables in seperate statements.
To do that, you may have to modify your query by adding the
Primary Key fields of each table that u want to update.
Ron
--
+----------------------------------------------------------+
| Ron Johnson, Jr. Home: ron.l.johnson@home.com |
| Jefferson, LA USA WWW : ronjohnsonjr@yahoo.com |
| http://ronandheather.dhs.org
|
+----------------------------------------------------------+
--
---------------------------------------------------------------------
Please check "http://www.mysql.com/documentation/manual.php"
before
posting. To request this thread, e-mail mysql-thread53403@lists.mysql.com
To unsubscribe, send a message to:
<mysql-unsubscribe-Chua=mail.interclean.com@lists.mysql.com>
If you have a broken mail client that cannot send a message to
the above address (Microsoft Outlook), you can use:
http://lists.mysql.com/php/unsubscribe.php