Hi,

Dont know if my last post got to the list, but since then my problem got a bit
more complicated. I know how to solve it using two or more queries, but was
wondering if it would be possible using only one:

tableA

id_tA  numof  descr
1      0809   john
2      0808   peter

table_out

id_tOut  id_tA  ref
1        2      samantha


table_In

id_tIn   numof  ref
1        0809   something


And the result i need is:

Table_result

id_tA    numof  ref
1        0809   something
2        0808   samantha


In a nutshell, i need a query intelligent enough to make a query to table_Out,
see if theres a match for 'id_tA', if there is one, retrieve field "ref",
otherwise go look in table_In and retrieve "ref" from there.

Is it too complicated (impossible?) to use only one query? Should i just do it
the old style, two queries and a php condition between them?

Thanks, guys.


Pag



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

Reply via email to