![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 3 of 3 total |
![]() |
Mon, Dec 1 2014 5:15 PM | Permanent Link |
Mike | Hi,
I have a pricelist table and article table. article_id pricelist_id 1 4 1 9 2 5 3 11 4 14 4 32 pricelist_id price 4 55 9 2 5 11 11 44 14 24 32 5 How can the following result be generated? article_id price 1 2 2 11 3 44 4 5 Per article_id the highest pricelist_id should be used. How could this be done? Thanks in advance. Mike |
Tue, Dec 2 2014 4:45 AM | Permanent Link |
Roy Lambert NLH Associates ![]() | Mike
select a.article_id, p.price from (select article_id,Max(pricelist_id) as pricelist_id from articles group by article_id) a left join pricelist p on a.pricelist_id = p.pricelist_id Roy Lambert |
Tue, Dec 2 2014 2:05 PM | Permanent Link |
Mike | Hi Roy,
Thank you. Will try it out. Greetz. Mike |
This web page was last updated on Wednesday, July 2, 2025 at 06:46 PM | Privacy Policy![]() © 2025 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |