on 12/29/03 12:00 PM, Bjoern Wuest wrote:

> Hello
> 
> I have the following problem:
> 
> Table1 'pl':
> +---+---+
> | p | o |
> +---+---+
> 
> Table2 'ln':
> +---+------+---+
> | p |   l  | v |
> +---+------+---+
> 
> Now my problem: how to write a statement to select all 'p' and 'v' from 'pl'
> and 'ln' where 'o=1' and 'l=de' or 'l=null if l=de is unavailable'. The
> result is shown below:

So... something like this?

SELECT ln.p, ln.v FROM pl, ln WHERE pl.p = ln.p AND ( (pl.o = 1 AND ln.l = 'de') OR 
ln.l IS NULL);

-- 
Bob
IQ2GI5SCP2

Things You Don't Hear Every Day, #'s 16 and 17:
A professor: "It's all right if you come to class high."
A(nother) professor: "I think base 16 is cool."
--


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to