I have the tickets table and the questions table in the questions table there is an id_ticket field, I need to pull out all the tickets and the number of questions in the ticket

SELECT *, COUNT (tickets.id) FROM tickets LEFT JOIN questions ON (questions.id_ticket = tickets.id)

I tried something like that but it doesn't work

  • Replace the star with a list of specific fields. - Akina
  • I need all fields from the tickets table + question-count field - sokolDev 5:27 pm
  • You need to add group by and list in it all the fields of the first table (according to which the grouping itself). And in this case * will not help - Mike
  • @Mike thanks helped) - sokolDev

0