Q:

How to get count of rows returned from nested and WHERE IN used query in MySQL?

SELECT kullaniciNick,
       kullaniciAdi,
       kullaniciSoyadi
FROM panelkullanicilari
WHERE id IN
    (SELECT user_id
     FROM proje_ekip
     WHERE proje_id=11)
ORDER BY kullaniciSoyadi

at the query i need the count of rows to check if it is over 6 or less. 
When i used the COUNT(*) i got an error message. That said it must used with GROUP BY.
Thank you.

A:

Try this:
SELECT kullaniciNick,
       kullaniciAdi,
       kullaniciSoyadi,
       count(*) -- Added this line
FROM panelkullanicilari
WHERE id IN
    (SELECT user_id
     FROM proje_ekip
     WHERE proje_id=11)
GROUP BY 1,2,3 -- Added this line
ORDER BY kullaniciSoyadi

