RE: SELECT this IF that

2002-03-07 Thread Forer, Leif
name', > SUM(log.hours) AS 'hours' > FROM log LEFT OUTER JOIN empnum > ON log.id = empnum.id > WHERE log.pj = '$pj' GROUP BY id; -Original Message- From: DL Neil [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 05, 2002 6:42 PM To: Forer, Leif; 'Nathan

RE: SELECT this IF that

2002-03-05 Thread Bill Easton
can't do it in MySQL without a temporary table or some procedural programming. Hope this helps a little. Date: Tue, 05 Mar 2002 13:56:34 -0500 From: "Forer, Leif" <[EMAIL PROTECTED]> Subject: SELECT this IF that To: "'[EMAIL PROTECTED]'" <[EMAIL PROTEC

Re: SELECT this IF that

2002-03-05 Thread DL Neil
Leif, > I'm not sure what you mean by "tbl2's population is a sub-set of that > in tbl1". tbl1 contains user id nums and hours each user spent working on a > project. tbl2 contains user id nums and the first and last names that > correspond to each user id. There are user id nums in tbl1 that

RE: SELECT this IF that

2002-03-05 Thread Weaver, Walt
fields that are null. :>) --Walt -Original Message- From: Forer, Leif [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 05, 2002 1:58 PM To: 'DL Neil'; 'Nathan'; [EMAIL PROTECTED] Subject: RE: SELECT this IF that DN- I'm not sure what you mean by "tbl2's pop

RE: SELECT this IF that

2002-03-05 Thread Forer, Leif
DN- I'm not sure what you mean by "tbl2's population is a sub-set of that in tbl1". tbl1 contains user id nums and hours each user spent working on a project. tbl2 contains user id nums and the first and last names that correspond to each user id. There are user id nums in tbl1 that do not exi

Re: SELECT this IF that

2002-03-05 Thread Nathan
like. Does that not fit in with your plans? # Nathan - Original Message - From: "Forer, Leif" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, March 05, 2002 11:56 AM Subject: SELECT this IF that I want to select and join data from two tables if the same id

Re: SELECT this IF that

2002-03-05 Thread DL Neil
Leif, > I want to select and join data from two tables if the same id exists in both > tables. If the id only exists in one table I want MySQL to return a string > like "sorry, no records found". How can I do this? > > I'm guessing it's something like: > > mysql> SELECT tbl1.this, tbl2.that FRO

SELECT this IF that

2002-03-05 Thread Forer, Leif
I want to select and join data from two tables if the same id exists in both tables. If the id only exists in one table I want MySQL to return a string like "sorry, no records found". How can I do this? I'm guessing it's something like: mysql> SELECT tbl1.this, tbl2.that FROM tbl1, tbl2 WHERE