How to use where condition for the for a selected column using subquery?

Posted by Holicreature on Stack Overflow See other posts from Stack Overflow or by Holicreature
Published on 2010-04-29T06:09:02Z Indexed on 2010/04/29 6:17 UTC
Read the original article Hit count: 299

Filed under:
|
|

I have two columns as company and product.

I use the following query to get the products matching particular string...

select id,(select name from company where product.cid=company.id) as 
company,name,selling_price,mrp from product where name like '$qry_string%'

But when i need to list products of specific company how can i do?

i tried the following but in vein

select id,(select name from company where product.cid=company.id) as
company,name,selling_price,mrp from product where company like '$qry_string%'

Help me

© Stack Overflow or respective owner

Related posts about mysql

Related posts about subquery