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

In group by some times we need to put max or min .

$
0
0

Dear all,

In following query

select  tid, max(colint), min(colvarchar),count(*) from

t group by tid

if i have duplicate records on tid, i want to know count of them and want to display their cols also.

what should i use max or min or any other thing.

i know that colint and colvarchar will be same for duplicate record.

yours sincerely.

           


Viewing all articles
Browse latest Browse all 23857

Trending Articles



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