Jump to content
Fórum Script Brasil
  • 0

(Resolvido) Ajuda com SELECT COUNT (*) com filtro (Resolvido)


RRH

Question

Tenho o seguinte select:

$sql = "SELECT placa, COUNT(*) AS total FROM veic GROUP BY placa ORDER BY total DESC, placa ASC";

Ele agrupa por placa e dá o total.

Ex:

AAA-0000 = 5

BBB-1111 = 1

CCC-2222 = 6

DDD-3333 = 1

EEE-4444 = 10

FFF-5555 = 12

Agora a minha dúvida é se tem como filtrar de forma que só mostre "PLACA > 1" exibindo apenas as placas abaixo:

AAA-0000 = 5

CCC-2222 = 6

EEE-4444 = 10

FFF-5555 = 12

Edited by RRH
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...