P
pat12
Hello
There is two tables:
1.
product_nb;price_start_date;shop;price
2.
Days (dates from two months day par day)
I try to get the info about the price for each shop and each product
for each day from second table
Here is my query:
Select a.product_nb,b.days,a.price_start_date,a.shop, a.price
from table1 as a,table2 as b
where a.price_start_date=(select max(c.price_start_date) from table1
as c where a.shop=c.shop and a.product_nb=c.product_nb and
a.price_start_date<=b.days)
It gives me data but not for all days from table2
Where I went wrong? I totally confused how the subquery works now
Any suggestion appreciated
PAT
There is two tables:
1.
product_nb;price_start_date;shop;price
2.
Days (dates from two months day par day)
I try to get the info about the price for each shop and each product
for each day from second table
Here is my query:
Select a.product_nb,b.days,a.price_start_date,a.shop, a.price
from table1 as a,table2 as b
where a.price_start_date=(select max(c.price_start_date) from table1
as c where a.shop=c.shop and a.product_nb=c.product_nb and
a.price_start_date<=b.days)
It gives me data but not for all days from table2
Where I went wrong? I totally confused how the subquery works now
Any suggestion appreciated
PAT