Home > database >  After mysql how to implement to query the results of data as a table, then according to the generate
After mysql how to implement to query the results of data as a table, then according to the generate

Time:10-02

I hope to get the result: here through the query, check out the two results, to the next step is: table 1 goosId corresponding table 2 goodsId, two goosId corresponding words in the table is executed number * sum (quantity) columns, (where the two tables is not existing in the table), each elder, expert advice, thank you for the below (map), and then show the goodsId columns, partsId column, number * sum (quantity) column

Table 1:


Table 2:

CodePudding user response:

 select al-qeada oodsId, Amy polumbo artsId, a.n umber * b.q uantity 
The from (
Your first query here
), a (
Your second query here, query the sum (quantity) as quantity after
B)
Where al-qeada oodsId=b.g oodsId

CodePudding user response:

Select *
The from (select * from a1 whre XXX) tb1, (select * from a2 whre XXX) tb2
Where tb1. Id=tb2. Id

CodePudding user response:

Be nested, before you write a statement of the results as a table, with a () name, outside in operation, you need connect these two tables have a al-qeada oodsid=b.g oodsid. Can do not exist the connection between the table
  • Related