Home > database >  Under the great god, please help to see, can you to solve it, and to check last year data and in mul
Under the great god, please help to see, can you to solve it, and to check last year data and in mul

Time:12-15


 SELECT *, - the main query CG to fk1 - FK all linked data 
(SELECT MAX (PRICE) FROM fk1 - FK A1 LEFT JOIN FKA ON A1, B1 ID=B1. The ID WHERE B1. ITMID=B.I TMID AND A1. OPDATE????? - o FKA table, ITMID today latest price last year and the corresponding fk1 - FK. ID number (there may be multiple rows of data, only in the last row material price), if no data today last year, taking more than last year, today the first day of a price and the corresponding fk1 - FK. ID number (there may be multiple rows of data, only take one of the most front row material price)
The FROM CG A
LEFT the JOIN CGA ON Anderson, D=B B.I D
LEFT the JOIN FKA ON B.I C D=Arthur c. KID AND B.L INENUM=Arthur c. KLINENUM
LEFT the JOIN ON D.I fk1 - FK D D=C.I D
WHERE A.O PDATE>='2020-11-01' AND A.O PDATE & lt;
='2020-11-22'
  • Related