Vaibhav Goel
asked on
My Query is not giving correct result. Please help
Hi,
I am trying to find Min value. But my query is not giving correct result.
SELECT MIN(col1)
FROM tablename
GROUP BY col1
Please help.
I am trying to find Min value. But my query is not giving correct result.
SELECT MIN(col1)
FROM tablename
GROUP BY col1
Please help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you do not include a GROUP BY clause you will get the min value for the whole column (you can only get one row).
If you DO include a GROUP BY clause you will get the min value for each GROUP BY (so you can get multiple rows)
If you DO include a GROUP BY clause you will get the min value for each GROUP BY (so you can get multiple rows)
Try
SELECT MIN(col1)
FROM tablename
ASKER
Thanks guys for helping.
Open in new window
let us know what you trying to get here. alternatively provide some sample data and the expected result.