We Recommend

SQL Cookbook SQL Cookbook
Written in O'Reilly's popular Problem/Solution/Discussion style, the SQL Cookbook is sure to please. Anthony's credo is: "When it comes down to it, we all go to work, we all have bills to pay, and we all want to go home at a reasonable time and enjoy what's still available of our days." The SQL Cookbook moves quickly from problem to solution, saving you time each step of the way.


Posted By

goodkail on 07/06/06


Tagged

select count distinct


Versions (?)


select count distinct


Published in: SQL 


  1. SELECT DISTINCT pt_services.service_bezeichnungen, pt_class_services.class_services_name, count(*) AS total
  2. FROM service
  3. INNER JOIN pt_services
  4. ON service.id_pt_service = pt_services.id_pt_service
  5. INNER JOIN pt_class_services
  6. ON service.id_class_services = pt_class_services.id_class_services
  7. GROUP BY pt_services.id_pt_service, pt_class_services.id_class_services;

Report this snippet 

You need to login to post a comment.