SQL query to count number of distinct products

0 votes
how many customers ordered a distinct products and sort by count of distinct products?
Jun 10, 2019 in Tableau by preethi
93 views

1 answer to this question.

0 votes
Hi Preethi,

Use below SQL query,

SELECT CUST_ID, COUNT(DISTINCT PROD_ID) FROM ORDERS GROUP BY CUST_ID ORDER BY COUNT(DISTINCT PROD_ID);
answered Jun 10, 2019 by anonymous
• 32,440 points

Related Questions In Tableau

0 votes
1 answer

How to use LOD to count distinct number of records based on some condition?

From the desired output it seems that ...READ MORE

answered Apr 9, 2018 in Tableau by xyz
• 1,550 points
7,870 views
0 votes
1 answer

how to get the count of non zero values in a row

In first part you should solve the ...READ MORE

answered Apr 4, 2018 in Tableau by Atul
• 10,250 points
299 views
0 votes
1 answer

How to count occurrence of value and percentage of a subset in tableau public?

Although it sounds like a fairly easy ...READ MORE

answered Jun 5, 2018 in Tableau by Atul
• 10,250 points
4,743 views
+1 vote
1 answer

How to calculate the number of hours worked in Tableau?

Try using this LOD expression {fixed user : ...READ MORE

answered Aug 3, 2018 in Tableau by Atul
• 5,530 points
123 views
0 votes
1 answer

How to access MYSQL Database from tableau?

Hi Sindhu,  1. Double click on Mysql on the ...READ MORE

answered Mar 19, 2019 in Tableau by Cherukuri
• 32,440 points
190 views
0 votes
1 answer

Want a command to be executed in Salt only if a directory is empty

You should consider using this inside your ...READ MORE

answered Jun 12, 2018 in DevOps Tools by Damon Salvatore
• 5,520 points
60 views
0 votes
1 answer

Creating A New MySQL User In Amazon RDS Environment

AWS RDS security groups documentation (a common ...READ MORE

answered Jul 18, 2018 in AWS by Priyaj
• 57,530 points
390 views
0 votes
1 answer

How to aggregate and count the occurrence of TRUE and FALSE?

Hi, you can do any of below ...READ MORE

answered Mar 12, 2019 in Tableau by Cherukuri
• 32,440 points
123 views
0 votes
1 answer

How to get only the last n months action of all my records?

Hi Nithin, You can use Calculated field to ...READ MORE

answered Mar 8, 2019 in Tableau by Cherukuri
• 32,440 points
71 views