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
1,456 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
• 33,010 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,560 points
15,972 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,230 points
2,096 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,230 points
10,294 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 4, 2018 in Tableau by sdfg
• 5,550 points
686 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
• 33,010 points
1,923 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,980 points
693 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
• 58,080 points
1,379 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
• 33,010 points
1,000 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
• 33,010 points
261 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP