Home > database >  Help: products and blank data matching query problem
Help: products and blank data matching query problem

Time:11-17

Products and data are stored in two tables, the blank blank may be scrapped, so products and blank is a one-to-many relationship,
I now want to check out the blank and product information online processing, no blank products need a list
Blank scrap temporarily also need not to have a new blank, blank data is empty

How to write this statement, please?
I now is to use the select products. *, blank. * from products left outer join blank on products. The id=blank. The pid
It can query the normal blank and no blank in the process of product, but couldn't query the blank scrap but there's no new products of blank

CodePudding user response:

Write wrong, actually cannot edit
I write is can check out without blank products and have all the rough blank products, but blank scrap but no new blank check out
Select products. *, blank. * from products left outer join blank on products. The id=blank. The pid and blank. State<> 'dead'

CodePudding user response:

Select *
The from products
Left the join blank on products. Id=blank. Pid

With respect to OK, or I didn't understand to the requirements of the building Lord?

CodePudding user response:

refer to the second floor lich2005 response:
select *
The from products
Left the join blank on products. Id=blank. Pid

With respect to OK, or I didn't understand to the requirements of the building Lord?

Sorry, subject to write wrong, please look at the content of the 1st floor

CodePudding user response:

Select *
The from blank
Left the join products on products. Id=blank. Pid
  • Related