You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATETABLEyour_table (
id INTPRIMARY KEY,
status VARCHAR(255) NOT NULL,
INDEX idx_status (status)
);
SELECTt1.id, t1.status, COUNT(t2.id) AS count
FROM task t1
JOIN task t2 ONt1.status=t2.statusANDt1.id>t2.idWHEREt1.idIN (id1, id2, id3, ...)
GROUP BYt1.id, t1.status;
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
MySQL:
Beta Was this translation helpful? Give feedback.
All reactions