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
3,337 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,030 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
17,355 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,240 points
3,092 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,240 points
11,727 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 ffdfd
• 5,550 points
1,481 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,030 points
3,137 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
1,835 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,020 points
2,056 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,030 points
2,937 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,030 points
743 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP