Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erro de SQL #118

Open
barisonalisson opened this issue Sep 27, 2024 · 0 comments
Open

Erro de SQL #118

barisonalisson opened this issue Sep 27, 2024 · 0 comments

Comments

@barisonalisson
Copy link

barisonalisson commented Sep 27, 2024

Falta adicionar uma condição ao INNER JOIN para o filtro ficar correto
-- caracterizando os registros dos artistas
SELECT a2.ArtistId, a2.Name, count() as Records from Album a INNER JOIN Artist a2 ON a2.ArtistId=a.ArtistId GROUP BY 1;
SELECT a2.ArtistId, a2.Name, count(
) as Records from Album a INNER JOIN Artist a2 ON a2.ArtistId=a.ArtistId GROUP BY 1 ORDER BY Records DESC ;

O mesmo na sql:
SELECT i.InvoiceId, il.InvoiceLineId FROM Invoice i
INNER JOIN InvoiceLine il ON il.InvoiceId = i.InvoiceId
INNER JOIN Customer c ON c.CustomerId = i.CustomerId
GROUP BY 1
LIMIT 100;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant