Thursday, 15 May 2014

inner join - mysql help: Joining Two Tables With a Where Clause and Displaying Rows From the Other -



inner join - mysql help: Joining Two Tables With a Where Clause and Displaying Rows From the Other -

write select statement list products vendor info products purchased after 2010-1-15.

i have tried multiple different commands best results beingness from:

select * product p_indate > '2010-1-15';

lists info product table instead of vendor and

select p_indate product right bring together vendor on p_indate > '2010-1-15';

just lists p_indate 11 duplicate values each date meets conditions

i have tried searching awhile , nil seems fit question, help!

here tables: vendor:

v_code(primary)|v_name|v_contact|v_areacode|v_phone|v_state|v_order

product

p_code(primary)|p_descript|p_indate(foreign)|p_qoh|p_min|p_price|p_discount|v_code(foreign)

you can specify p.* , v.* in select product , vendor data

select p.*, v.* product p bring together vendor v on p.v_code = v.v_code p.p_indate > '2010-01-15' ;

you can pick , take fields homecoming prefixing them p.field name or v.field_name

mysql inner-join outer-join

No comments:

Post a Comment