Search
Search titles only
By:
Search titles only
By:
Menu
Forums
New posts
Search forums
Home
What's new
New posts
Latest activity
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Reply to thread
Home
Education
Academic
How to get rows with lowest value from a group by? - Weddo
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="v32457_p" data-source="post: 521" data-attributes="member: 5"><p>How to get rows with lowest value from a group by? </p><p></p><p>Hi Experts </p><p>I have a database of beverages, with following tables:</p><p>Beverage (code, name, size) Primary key=code</p><p>Store (name, area, phone) Primary key=name</p><p>Sells (store_name, code, price) store_name refers to name(store) and code to code(beverage). </p><p></p><p>I need to find the code and name of the least expensive beverages for each store (1 value per store), but I am only able to find minimum price per store without the code via: </p><p>SELECT store_name, MIN(price) FROM Sells GROUP BY store_name ORDER BY...</p><p></p><p><a href="https://www.go4expert.com/articles/rows-lowest-value-t35465/" target="_blank">How to get rows with lowest value from a group by?</a></p></blockquote><p></p>
[QUOTE="v32457_p, post: 521, member: 5"] How to get rows with lowest value from a group by? Hi Experts I have a database of beverages, with following tables: Beverage (code, name, size) Primary key=code Store (name, area, phone) Primary key=name Sells (store_name, code, price) store_name refers to name(store) and code to code(beverage). I need to find the code and name of the least expensive beverages for each store (1 value per store), but I am only able to find minimum price per store without the code via: SELECT store_name, MIN(price) FROM Sells GROUP BY store_name ORDER BY... [URL='https://www.go4expert.com/articles/rows-lowest-value-t35465/']How to get rows with lowest value from a group by?[/URL] [/QUOTE]
Insert quotes…
Verification
Post reply
Home
Education
Academic
How to get rows with lowest value from a group by? - Weddo
Top
Bottom
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…