Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

HAVING Criteria

$
0
0

Hi,

I have added a HAVING onto my code as I need to only bring back values that are >0

This is my HAVING below

HAVING sum(S_Val) > '0' 
and sum(T_Val) > '0'

Both columns have 0 values in them. 

The issue I have is when I use the HAVING as above, 0 records return. If I use a HAVING with one criteria, I get results returned. Any idea why it would return no data on my current logic please, have I missed something off the HAVING?


Viewing all articles
Browse latest Browse all 7129

Trending Articles



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