M
M
moem2017-07-17 11:21:06
SQL
moem, 2017-07-17 11:21:06

How to get non-repeating combinations of two or more fields and the number of such combinations?

Hello.
Given: view table

field1field2fieldN
aa...
ab...
ba...
ab...
aa...
bb...

Please tell me how to get non-repeating combinations of two fields and the number of such combinations. Those. the result should look like this
field1field2count
aa2
ab2
baone
bbone

Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
gill-sama, 2017-07-17
@moem

group by

select fld1, fld2, count(*) from tblname group_by fld1, fld2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question