Re: [PHP] need help for a where clause

2002-10-07 Thread Philipp Lutz
If you are using MySQL you may want to look at the CASE statement in the "Control flow functions for use with SELECT Statements" it would look like SELECT CASE A.Afn WHEN 1 THEN B.Bfn1 WHEN 2 THEN B.Bfn2 WHEN 3 THEN B.Bfn3 FROM A,B IN MySQL Hope That Helps.. Phil "Alex S

Re: [PHP] need help for a where clause

2002-10-06 Thread Alex Shi
Thanks! This is what I need! Alex Shi "Sascha Cunz" <[EMAIL PROTECTED]> 写入消息新闻 :[EMAIL PROTECTED] A solution on that depends strongly on how much values A.Afn would take. For 3, it's still okay. But i wouldn't do more. Against what shall the B.Bfn* be checked? What Data do you want to be retu

Re: [PHP] need help for a where clause

2002-10-06 Thread Sascha Cunz
A solution on that depends strongly on how much values A.Afn would take. For 3, it's still okay. But i wouldn't do more. Against what shall the B.Bfn* be checked? What Data do you want to be returned from the query? try: SELECT ### FROM A, B WHERE ((A.Afn=1) AND (B.Bfn1 = ...)) OR ((A.Af

RE: [PHP] need help for a where clause

2002-10-06 Thread David Freeman
> I need a where clause in following situation: > > Say I want to query two tables: A and B. In table A there is field > Afn, while in table B there are 3 fields: Bfn1, Bfn2 and > Bfn3. I want > to do a query, in which the where clause must do these things: > > if A.Afn=1, then che

[PHP] need help for a where clause

2002-10-06 Thread Alex Shi
Hi, I need a where clause in following situation: Say I want to query two tables: A and B. In table A there is field Afn, while in table B there are 3 fields: Bfn1, Bfn2 and Bfn3. I want to do a query, in which the where clause must do these things: if A.Afn=1, then check value of B.Bfn1; i