SQL Server Management
How can i write a query to view the minimum value row(and onlythat row) of a table where the minimum value in one column isdependent on another column
For example:
I want to display the row with the lowest price with CategoryID1, but I want to create a seperate query with the lowest price fromCategoryID2
Solution
There are different ways you can achieve this using SQL.
1stMethod-
If you want two separate queries for selecting minimum value rowin each category id, use the below two queries. Sub query is usedin WHERE clause.
For CategoryID = 1
SELECT *
FROM TableName
WHERE Price = (SELECT
OR
OR