Home > database >  MY - SQL query functions
MY - SQL query functions

Time:10-05

I've got a number of clients to buy the product sheet table, there is no law, there are some customers buy a product, some bought the product of two or more, I want to fast statistics out clients to buy goods, see the attachment, use MY - how to implement SQL,
There are three single table A/B/C
Customers domestic customer imported cars, auto parts
Wang mou bus wang mou 1 wang mou 1 piece
Li mou, wu a 1 2, li mou
Three pieces of zhao mou 2 bus Wu Mou 2 zhao mou
Zeng Mou 1 Wu Ou 4 pieces

After the search to:
Customers buy the products
Wang mou domestic cars and imported cars, auto parts
Li mou domestic cars, auto parts
Zhao mou domestic cars
Wu some imported cars
Wu Mou imported cars, auto parts
Imported cars Zeng Mou

CodePudding user response:

Three tables union all up and then price type fields, finally turn again
  • Related