Re: Problems building SQL Query using JOIN to assign fields
| From: | Martin Strojek | Date: | Wed, 09 Aug 2000 12:22:19 +0000 |
| Subject: | Re: Problems building SQL Query using JOIN to assign fields | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-1898@lists.php.net to get a copy of this message | ||
Hi folks, I did it. Thanks to JE.
Here's the correct statement:
select Info.*, InfoArt.strTyp
from Info left join InfoArt on Info.intInfoArt=InfoArt.ID
Regards
--
Martin Strojek
-Vorstand-
__________________________________________________________________________
SOLUTIONWORKS MULTIMEDIA AKTIENGESELLSCHAFT
Postfach 1422
24572 Bad Bramstedt
Fon: +49 4192 897654
Fax: +49 4192 897655
strojek@solutionworks.de
__________________________________________________________________________
""Martin Strojek"" <martin@solutionworks.de> schrieb im Newsbeitrag
news:8mr944$e7g$1@toye.php.net...
> Hi,
>
> as I read in this group, I think you're handling with bigger problems than
> mine. But maybe you can help.
>
> I want to join two tables in a query. A php skript displays the entrys of
> one table "Info". There's a field
> "intInfoArt" wich contains a number. This number is in the table
"InfoArt".
> In this table the second field is the Text to the number.
> So my query should take all entries from "Info" and look for "intInfoArt"
in
> the table "InfoArt" for the field ID and takes the Text
> to that ID (field "strTyp") and put it into the response data.
>
> i tried nearly every combination of SELECT... JOIN... ON...WHERE and
looked
> it up in a MySQL book.
> But this case is not explained. I just got querys that work, but this one
> would be my bullet:-)
>
> It would be nice if there's someone who could help.
>
> Data:
>
> Table1:
> name: "Info"
> fields: ID, intInfoArt, datDatum,......... have to displayed all
>
> Table2:
> name: "InfoArt"
> fields: ID, strTyp
>
> connection: intInfoArt from Info and ID from InfoArt
> result: strTyp from InfoArt
>
> Thanks a lot for your help
>
> --
> Martin Strojek
> __________________________________________________________________________
> SOLUTIONWORKS MULTIMEDIA AKTIENGESELLSCHAFT
> Postfach 1422
> 24572 Bad Bramstedt
> Fon: +49 4192 897654
> Fax: +49 4192 897655
> strojek@solutionworks.de
> __________________________________________________________________________
>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>