0
CREATE OR REPLACE VIEW organizedevent AS

    SELECT o.organizerID AS "Organizer ID", 
           o.organizerName AS "Name",
           o.contact AS "Contact",  
           COUNT(e.eventID) AS "Organized Event"
    FROM   Organizer o ,Event e
    WHERE  o.organizerID=e.organizerID
    GROUP BY o.organizerID,o.organizerName,o.contact,eventID
    HAVING COUNT(e.eventID) >=1
    ORDER BY o.organizerID ASC;

I need how to write the join table statement to get the answer as I want the answer like ORG1058 have count 2 and ORG1059 have count 6. enter image description here

  • 2
    Have you tried to remove eventID of GROUP BY clause? – McNets Aug 4 at 11:25
  • If you are using MySQL as the title of your question suggests, tag your question with mysql instead of sql-server (Microsoft SQL Server). – Dan Guzman Aug 4 at 14:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.