Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

Does the order of columns matter in SQL statement - response (2) by mathiroom

$
0
0
Order of the columns doesn't make problem. if you are selecting fileds with aggregate function used in query, you shoud have to do GROUP BY. otherwise non-aggregate problem will occur. Try the below query, it works sel A1-A1NC as A1C, A1,B1  from (sel sum(case when IND=1 then 1 else 0 end) A1 from TN)t,TN sel (sel sum(case when IND=1 then 1 else 0 end) A1 from TN)-A1NC as A1C, B1 from TN

Viewing all articles
Browse latest Browse all 27759

Trending Articles



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