Mailinglisten-Archive |
This is a multi-part message in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C22E7C.F44DB170 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hey wow! Danke, das wars. Ich mu=DF mal nachlesen was ich da genau gemacht habe, aber dein Beispiel hat mir gut geholfen, es funkt jetzt. Anbei noch das Statement :) See ya und DANKE Chris SELECT poss_members.visible_name AS author, poss_artist.name AS artist, poss_releases.title AS articlename, poss_reviews.date_submit AS dateOfWriting, poss_categories.species AS style, poss_reviews.points_music AS pointsMusic, poss_reviews.points_lyrics AS pointsLyrics, poss_reviews.points_sound AS pointsSound, poss_reviews.text AS review, poss_contactperson.name AS contactName, poss_contactperson.firstname AS contactFirstName, poss_contactperson.street AS contactStreet, poss_contactperson.zip AS contactZip, poss_contactperson.city AS contactCity, poss_contactperson.email AS contactEmail, poss_contactperson.phone AS contactPhone, poss_contactperson.mobile AS contactMobile, poss_contactperson.fax AS contactFax, poss_label.name AS labelName, poss_label.id AS labelID, poss_links.id AS linkID, poss_links.title AS linkTitle=20 FROM poss_categories, poss_reviews, poss_releases, poss_artist, poss_members, poss_contactperson, poss_label=20 LEFT OUTER JOIN poss_links ON (poss_artist.id_links =3D poss_links.id)=20 WHERE poss_reviews.id_member =3D poss_members.id=20 AND poss_reviews.id_releases =3D poss_releases.id=20 AND poss_releases.id_artist =3D poss_artist.id=20 AND poss_reviews.id_categories =3D poss_categories.id=20 AND poss_artist.id_contactperson =3D poss_contactperson.id=20 AND poss_releases.id_label =3D poss_label.id=20 AND (poss_artist.id_links =3D poss_links.id OR poss_artist.id_links IS = NULL )=20 AND poss_reviews.id =3D '1'=20 -----Urspr=FCngliche Nachricht----- Von: Ralf Narozny [mailto:rnarozny_(at)_splendid.de] Gesendet: Donnerstag, 18. Juli 2002 18:42 An: mysql-de_(at)_lists.4t2.com Betreff: Re: AW: Ergebnisse bekommen, auch wenn teilweise nichts = drinnen ist Hallo! Lieber mal ein kleines Beispiel: TAB1: +------+------+ | f1 | f2 | +------+------+ | 1 | a | | 2 | a | | 3 | b | | 4 | c | +------+------+ TAB2: +------+------+ | f3 | f4 | +------+------+ | 1 | 9 | | 2 | 8 | | 4 | 6 | +------+------+ TAB1 ist meine 'Refernztabelle' SELECT t1.f1, t1.f2, t2.f4=20 FROM tab1 t1=20 LEFT OUTER JOIN tab2 t2 ON (f1=3Df3)=20 WHERE (t1.f1 =3D t2.f3 OR t2.f3 IS NULL); Ergibt dann: +------+------+------+ | f1 | f2 | f4 | +------+------+------+ | 1 | a | 9 | | 2 | a | 8 | | 3 | b | NULL | | 4 | c | 6 | +------+------+------+ Dabei habe ich dann auch gemerkt, da=DF MySQL dann extra gesagt = bekommen=20 mu=DF, da=DF man OUTER JOIN verwenden will. Gru=DF Ralf Grobmeier, Christian wrote: > Hallo, > danke f=FCr die schnelle Antwort! > > > >> (x.id =3D y.id OR y.id IS NULL OR x.id IS NULL) > > Das hab ich jetzt mal gemacht. > Wie funkt denn das genau? ich bekomme jetzt praktisch eine > Ergebnissliste in der alle Links mit meinem Statement verkn=FCpft = werden. > > review.link_id =3D link.id OR review.link_id IS NULL > > Bedeuted das, ich nehme alles mit ins Ergebniss wo im der Spalte=20 > review.link_id > NULL drinsteht mitrein? > > Gru=DF > Chris > --=20 Ralf Narozny SPLENDID Internet GmbH & Co KG Skandinaviendamm 212, 24109 Kiel, Germany fon: +49 431 660 97 0, fax: +49 431 660 97 20 mailto:rnarozny_(at)_splendid.de, http://www.splendid.de --- Infos zur Mailingliste, zur Teilnahme und zum An- und Abmelden unter -->> http://www.4t2.com/mysql=20 ------_=_NextPart_001_01C22E7C.F44DB170 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">=0D <HTML>=0D <HEAD>=0D <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; charset=3Diso-8859-= 1">=0D <META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version 5.5.2653.12"= >=0D <TITLE>AW: Ergebnisse bekommen, auch wenn teilweise nichts drinnen ist</TIT= LE>=0D </HEAD>=0D <BODY>=0D =0D <P><FONT SIZE=3D2>Hey wow!</FONT>=0D <BR><FONT SIZE=3D2>Danke, das wars.</FONT>=0D <BR><FONT SIZE=3D2>Ich mu=DF mal nachlesen was ich da genau gemacht habe,</= FONT>=0D <BR><FONT SIZE=3D2>aber dein Beispiel hat mir gut geholfen, es funkt jetzt.= </FONT>=0D <BR><FONT SIZE=3D2>Anbei noch das Statement :)</FONT>=0D </P>=0D =0D <P><FONT SIZE=3D2>See ya und DANKE</FONT>=0D <BR><FONT SIZE=3D2>Chris</FONT>=0D </P>=0D =0D <P><FONT SIZE=3D2>SELECT poss_members.visible_name AS author,</FONT>=0D <BR><FONT SIZE=3D2> poss_artist.name AS artist,</FONT>=0D <BR><FONT SIZE=3D2> poss_releases.title AS articlename,</FONT>=0D <BR><FONT SIZE=3D2> poss_reviews.date_submit AS dateOfWriting,</FONT>= =0D <BR><FONT SIZE=3D2> poss_categories.species AS style,</FONT>=0D <BR><FONT SIZE=3D2> poss_reviews.points_music AS pointsMusic,</FONT>= =0D <BR><FONT SIZE=3D2> poss_reviews.points_lyrics AS pointsLyrics,</FONT>= =0D <BR><FONT SIZE=3D2> poss_reviews.points_sound AS pointsSound,</FONT>= =0D <BR><FONT SIZE=3D2> poss_reviews.text AS review,</FONT>=0D <BR><FONT SIZE=3D2> poss_contactperson.name AS contactName,</FONT>=0D <BR><FONT SIZE=3D2> poss_contactperson.firstname AS contactFirstName,<= /FONT>=0D <BR><FONT SIZE=3D2> poss_contactperson.street AS contactStreet,</FONT>= =0D <BR><FONT SIZE=3D2> poss_contactperson.zip AS contactZip,</FONT>=0D <BR><FONT SIZE=3D2> poss_contactperson.city AS contactCity,</FONT>=0D <BR><FONT SIZE=3D2> poss_contactperson.email AS contactEmail,</FONT>= =0D <BR><FONT SIZE=3D2> poss_contactperson.phone AS contactPhone,</FONT>= =0D <BR><FONT SIZE=3D2> poss_contactperson.mobile AS contactMobile,</FONT>= =0D <BR><FONT SIZE=3D2> poss_contactperson.fax AS contactFax,</FONT>=0D <BR><FONT SIZE=3D2> poss_label.name AS labelName,</FONT>=0D <BR><FONT SIZE=3D2> poss_label.id AS labelID,</FONT>=0D <BR><FONT SIZE=3D2> poss_links.id AS linkID,</FONT>=0D <BR><FONT SIZE=3D2> poss_links.title AS linkTitle </FONT>=0D <BR><FONT SIZE=3D2>FROM poss_categories,</FONT>=0D <BR><FONT SIZE=3D2> poss_reviews,</FONT>=0D <BR><FONT SIZE=3D2> poss_releases,</FONT>=0D <BR><FONT SIZE=3D2> poss_artist,</FONT>=0D <BR><FONT SIZE=3D2> poss_members,</FONT>=0D <BR><FONT SIZE=3D2> poss_contactperson,</FONT>=0D <BR><FONT SIZE=3D2> poss_label </FONT>=0D <BR><FONT SIZE=3D2>LEFT OUTER JOIN poss_links ON (poss_artist.id_links =3D = poss_links.id) </FONT>=0D <BR><FONT SIZE=3D2>WHERE poss_reviews.id_member =3D poss_members.id </FONT>= =0D <BR><FONT SIZE=3D2>AND poss_reviews.id_releases =3D poss_releases.id </FONT= >=0D <BR><FONT SIZE=3D2>AND poss_releases.id_artist =3D poss_artist.id </FONT>= =0D <BR><FONT SIZE=3D2>AND poss_reviews.id_categories =3D poss_categories.id </= FONT>=0D <BR><FONT SIZE=3D2>AND poss_artist.id_contactperson =3D poss_contactperson.= id </FONT>=0D <BR><FONT SIZE=3D2>AND poss_releases.id_label =3D poss_label.id </FONT>=0D <BR><FONT SIZE=3D2>AND (poss_artist.id_links =3D poss_links.id OR poss_arti= st.id_links IS NULL ) </FONT>=0D <BR><FONT SIZE=3D2>AND poss_reviews.id =3D '1' </FONT>=0D </P>=0D <BR>=0D <BR>=0D <BR>=0D =0D <P><FONT SIZE=3D2>-----Urspr=FCngliche Nachricht-----</FONT>=0D <BR><FONT SIZE=3D2>Von: Ralf Narozny [<A HREF=3D"mailto:rnarozny_(at)_splendid.d= e">mailto:rnarozny_(at)_splendid.de</A>]</FONT>=0D <BR><FONT SIZE=3D2>Gesendet: Donnerstag, 18. Juli 2002 18:42</FONT>=0D <BR><FONT SIZE=3D2>An: mysql-de_(at)_lists.4t2.com</FONT>=0D <BR><FONT SIZE=3D2>Betreff: Re: AW: Ergebnisse bekommen, auch wenn teilweis= e nichts drinnen</FONT>=0D <BR><FONT SIZE=3D2>ist</FONT>=0D </P>=0D <BR>=0D =0D <P><FONT SIZE=3D2>Hallo!</FONT>=0D </P>=0D =0D <P><FONT SIZE=3D2>Lieber mal ein kleines Beispiel:</FONT>=0D </P>=0D =0D <P><FONT SIZE=3D2>TAB1:</FONT>=0D <BR><FONT SIZE=3D2>+------+------+</FONT>=0D <BR><FONT SIZE=3D2>| f1 | f2 |</FONT>=0D <BR><FONT SIZE=3D2>+------+------+</FONT>=0D <BR><FONT SIZE=3D2>| 1 | a |</FONT>=0D <BR><FONT SIZE=3D2>| 2 | a |</FONT>=0D <BR><FONT SIZE=3D2>| 3 | b |</FONT>=0D <BR><FONT SIZE=3D2>| 4 | c |</FONT>=0D <BR><FONT SIZE=3D2>+------+------+</FONT>=0D </P>=0D =0D <P><FONT SIZE=3D2>TAB2:</FONT>=0D </P>=0D =0D <P><FONT SIZE=3D2>+------+------+</FONT>=0D <BR><FONT SIZE=3D2>| f3 | f4 |</FONT>=0D <BR><FONT SIZE=3D2>+------+------+</FONT>=0D <BR><FONT SIZE=3D2>| 1 | 9 |</FONT>=0D <BR><FONT SIZE=3D2>| 2 | 8 |</FONT>=0D <BR><FONT SIZE=3D2>| 4 | 6 |</FONT>=0D <BR><FONT SIZE=3D2>+------+------+</FONT>=0D </P>=0D =0D <P><FONT SIZE=3D2>TAB1 ist meine 'Refernztabelle'</FONT>=0D </P>=0D =0D <P><FONT SIZE=3D2>SELECT t1.f1, t1.f2, t2.f4 </FONT>=0D <BR><FONT SIZE=3D2>FROM tab1 t1 </FONT>=0D <BR><FONT SIZE=3D2>LEFT OUTER JOIN tab2 t2 ON (f1=3Df3) </FONT>=0D <BR><FONT SIZE=3D2>WHERE (t1.f1 =3D t2.f3 OR t2.f3 IS NULL);</FONT>=0D </P>=0D =0D <P><FONT SIZE=3D2>Ergibt dann:</FONT>=0D </P>=0D =0D <P><FONT SIZE=3D2>+------+------+------+</FONT>=0D <BR><FONT SIZE=3D2>| f1 | f2 | f4 |</FO= NT>=0D <BR><FONT SIZE=3D2>+------+------+------+</FONT>=0D <BR><FONT SIZE=3D2>| 1 | a |  = ; 9 |</FONT>=0D <BR><FONT SIZE=3D2>| 2 | a |  = ; 8 |</FONT>=0D <BR><FONT SIZE=3D2>| 3 | b | NULL |</FO= NT>=0D <BR><FONT SIZE=3D2>| 4 | c |  = ; 6 |</FONT>=0D <BR><FONT SIZE=3D2>+------+------+------+</FONT>=0D </P>=0D =0D <P><FONT SIZE=3D2>Dabei habe ich dann auch gemerkt, da=DF MySQL dann extra = gesagt bekommen </FONT>=0D <BR><FONT SIZE=3D2>mu=DF, da=DF man OUTER JOIN verwenden will.</FONT>=0D </P>=0D =0D <P><FONT SIZE=3D2>Gru=DF</FONT>=0D <BR><FONT SIZE=3D2> Ralf</FONT>=0D </P>=0D =0D <P><FONT SIZE=3D2>Grobmeier, Christian wrote:</FONT>=0D </P>=0D =0D <P><FONT SIZE=3D2>> Hallo,</FONT>=0D <BR><FONT SIZE=3D2>> danke f=FCr die schnelle Antwort!</FONT>=0D <BR><FONT SIZE=3D2>></FONT>=0D <BR><FONT SIZE=3D2>></FONT>=0D <BR><FONT SIZE=3D2>> >> (x.id =3D y.id OR y.id IS NULL OR x.id IS = NULL)</FONT>=0D <BR><FONT SIZE=3D2>></FONT>=0D <BR><FONT SIZE=3D2>> Das hab ich jetzt mal gemacht.</FONT>=0D <BR><FONT SIZE=3D2>> Wie funkt denn das genau? ich bekomme jetzt praktis= ch eine</FONT>=0D <BR><FONT SIZE=3D2>> Ergebnissliste in der alle Links mit meinem Stateme= nt verkn=FCpft werden.</FONT>=0D <BR><FONT SIZE=3D2>></FONT>=0D <BR><FONT SIZE=3D2>> review.link_id =3D link.id OR review.link_id IS NUL= L</FONT>=0D <BR><FONT SIZE=3D2>></FONT>=0D <BR><FONT SIZE=3D2>> Bedeuted das, ich nehme alles mit ins Ergebniss wo = im der Spalte </FONT>=0D <BR><FONT SIZE=3D2>> review.link_id</FONT>=0D <BR><FONT SIZE=3D2>> NULL drinsteht mitrein?</FONT>=0D <BR><FONT SIZE=3D2>></FONT>=0D <BR><FONT SIZE=3D2>> Gru=DF</FONT>=0D <BR><FONT SIZE=3D2>> Chris</FONT>=0D <BR><FONT SIZE=3D2>></FONT>=0D </P>=0D =0D <P><FONT SIZE=3D2>-- </FONT>=0D <BR><FONT SIZE=3D2>Ralf Narozny</FONT>=0D <BR><FONT SIZE=3D2>SPLENDID Internet GmbH & Co KG</FONT>=0D <BR><FONT SIZE=3D2>Skandinaviendamm 212, 24109 Kiel, Germany</FONT>=0D <BR><FONT SIZE=3D2>fon: +49 431 660 97 0, fax: +49 431 660 97 20</FONT>=0D <BR><FONT SIZE=3D2><A HREF=3D"mailto:rnarozny_(at)_splendid.de">mailto:rnarozny_(at)_= splendid.de</A>, <A HREF=3D"http://www.splendid.de" TARGET=3D"_blank">http:= //www.splendid.de</A></FONT>=0D </P>=0D <BR>=0D <BR>=0D =0D <P><FONT SIZE=3D2>---</FONT>=0D <BR><FONT SIZE=3D2>Infos zur Mailingliste, zur Teilnahme und zum An- und Ab= melden unter</FONT>=0D <BR><FONT SIZE=3D2>-->> <A HREF=3D"http://www.4t2.com/mysql" TA= RGET=3D"_blank">http://www.4t2.com/mysql</A> </FONT>=0D </P>=0D =0D </BODY>=0D </HTML>=0D ------_=_NextPart_001_01C22E7C.F44DB170-- --- Infos zur Mailingliste, zur Teilnahme und zum An- und Abmelden unter -->> http://www.4t2.com/mysql
php::bar PHP Wiki - Listenarchive