Re: outer join question

2007-02-05 Thread KMiller
Thanks much! ViSolve DB Team-2 wrote: > > Hello, > > Try this... > > select a.rhrqid,a.rhrqsid,a.rhrssid,b.sid,b.rlsid > from rqhistory a left join relay b > on (a.rhrqid = b.rqid and (a.rhrqsid = b.rlsid or a.rhrqsid = b.sid or > a.rhrssid = b.rlsid or a.rhrssid = b.sid)) > where a.rhrqsi

Re: outer join question

2007-02-05 Thread ViSolve DB Team
Hello, Try this... select a.rhrqid,a.rhrqsid,a.rhrssid,b.sid,b.rlsid from rqhistory a left join relay b on (a.rhrqid = b.rqid and (a.rhrqsid = b.rlsid or a.rhrqsid = b.sid or a.rhrssid = b.rlsid or a.rhrssid = b.sid)) where a.rhrqsid = 101 or a.rhrssid = 101 Thanks, ViSolve DB Team - Ori

Re: Outer join question

2004-01-20 Thread Craig A. Finseth
First, you database design. You don't need to separate actresses from actors... Why do that? They are the same entity, a person, with only one different attribute: the genre. So, you should join them in one single table: ... Actually, it is possible to be female and to be an Ac

[Fwd: Re: Outer join question]

2004-01-20 Thread Diana Soares
Sorry, i meant "gender", not "genre". -Forwarded Message- First, you database design. You don't need to separate actresses from actors... Why do that? They are the same entity, a person, with only one different attribute: the genre. So, you should join them in one single table: Actors ==

Re: Outer join question

2004-01-20 Thread Diana Soares
First, you database design. You don't need to separate actresses from actors... Why do that? They are the same entity, a person, with only one different attribute: the genre. So, you should join them in one single table: Actors == act_id name genre ENUM('m','f') Then, the table DVD. If we ma

Re: Outer join question

2004-01-19 Thread daniel
> [EMAIL PROTECTED] wrote: >>> DVD_Actor: >>> dvd_ID REFERENCES DVD >>> actor_ID REFERNCES Actor >> >> Is this how you setup a join table ? > > Yes. > > >> what exactly is the references keyword ? > > It indicates a foreign key. Full syntax is something like: > dvd_ID CONSTRAINT dvc_fk FOREIGN KEY

Re: Outer join question

2004-01-19 Thread Jochem van Dieten
[EMAIL PROTECTED] wrote: DVD_Actor: dvd_ID REFERENCES DVD actor_ID REFERNCES Actor Is this how you setup a join table ? Yes. what exactly is the references keyword ? It indicates a foreign key. Full syntax is something like: dvd_ID CONSTRAINT dvc_fk FOREIGN KEY REFERENCES DVD (dvd_ID) Read the ma

Re: Outer join question

2004-01-19 Thread daniel
> > DVD_Actor: > dvd_ID REFERENCES DVD > actor_ID REFERNCES Actor > Is this how you setup a join table ? what exactly is the references keyword ? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: Outer join question

2004-01-19 Thread Jochem van Dieten
Bjorn Barton-Pye wrote: I am using a test database to teach myself MYSQL and am using my DVD collection as the subject. I have 3 tables in this example: Actresses === actr_id name Actors == acto_id name DVD == Title acto_id actr_id The acto_id and actr_id in the DVD table indicates the

Re: Outer join question

2004-01-19 Thread daniel
> so soemthing like > > select * from dvd left join actresses actr on actr.actr_id=dvd.actr_id > left join actors acto on acto.acto_id=dvd.acto_id or by dvd.title > > totally forgot, to get a really good query especially when you use Innodb it doesnt like null values on foreign keys, i'd setup a r

Re: Outer join question

2004-01-19 Thread daniel
> So, can somebody please correct the following query (and explain the > syntax) so that it will work please? (I haven't tried putting an outer > join in it because I don't understand the syntax.) > > Select > actr.name, > acto.name, > dvd.title > from > actresses actr, >

Re: outer join question

2001-11-30 Thread Steve Werby
"Harlan Feinstein" <[EMAIL PROTECTED]> wrote: > I've joined them an SQL statement that looks like this: > > select val, status > from A > left outer join B on val=id; > > What I'd LIKE is a 90-row result set, with the "status" field from table B > when there was data available. What I'm getting i