Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 12890

Min and max

$
0
0

hi

select id,min(actual) Min_Actual, max(actual) max_actual,
count(id)  from main
group by id


in min and max, i need to exclude actual = 0,  If use WHERE Acutal <> 0, my count(ID) will be wrong,  I want to count by id even actual is zero

Is it possible in one query

thanks

v


Viewing all articles
Browse latest Browse all 12890

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>