1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[SQL] I am writing sql for a project and having trouble with the IN function

Discussão em 'Outras Linguagens' iniciado por Stack, Outubro 5, 2024 às 21:02.

  1. Stack

    Stack Membro Participativo

    SELECT creditdescription, COUNT(encounter.encid) AS encounter_count
    FROM encounter
    inner JOIN customer ON encounter.customerid = customer.customerid
    inner join creditrating on customer.creditid = creditrating.creditid
    WHERE encounter.encdate IN ('2015-07-05', '2015-07-12', '2015-07-19', '2015-07-26')
    GROUP BY creditrating.creditdescription
    ORDER BY customer.creditid ASC


    Line 5 or the WHERE function line is not returning results but if I change it too = '2015-07-05' or '2015-07-12' or '2015-07-19' or '2015-07-26' then it returns results but with many warning signs how should I fix this?

    The questions I am answering: Management is considering closing on Sundays and would like to have a feeling for the kinds of customers that come to the dealership on Sunday. Create a totals query that shows the count of encounters on the Sundays of July 2015—grouped by the credit description held by the customer of the encounter. The Sundays in July of 2015 are the 5th, 12th, 19th, and 26th. Your answer should have two columns (CreditDescription and encounter_count) and should be sorted alphabetically by credit description.

    Continue reading...

Compartilhe esta Página