If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
query with subquery does not take all rows it should i think
wrote in message oups.com... On 27 Lut, 17:23, "Gary Walter" wrote: okay... change last line to c.price_start_date=b.days i.e., 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 c.shop=a.shop and c.product_nb=a.product_nb and c.price_start_date=b.days)- Ukryj cytowany tekst - - Pokaż cytowany tekst - YYYEEESSSS You changed one letter :-) and its working. It is so logical now. I was so stupid. Many many many thanks Gary I was loosing faith in sql instead of thinking All the best for you Patryk You're welcome Patryk. I know the feeling. Old trite American saying: "Been there, done that." |
|
Thread Tools | |
Display Modes | |
|
|