how to retrieve distinct values from multiple columns
- by ANIL MANE
Hello Experts,
I have a flat text file data which I import into MSSQL table.
It creates and table with specified name along with multiple columns as per data file.
now I need a query which will return the data and its count. e.g.
data file :
BREAD,MILK
BREAD,DIAPER,BEER,EGGS
MILK,DIAPER,BEER,COKE
BREAD,MILK,DIAPER,BEER
BREAD,MILK,DIAPER,COKE
BREAD,ICE,MANGO
JUICE,BURGER
Result should be
BREAD | 5
MILK | 4
DIAPER| 4
and so on.