I am new to SQL and need a little help with this query:
UPDATE student
SET s.date_of_birth= SELECT count(*) max date_of_birth
FROM student WHERE batch =st.batch
FROM student s, student st
WHERE st.date_of_birth IS NULL
All i need is to fill date_of_birth where it is empty by counting the most common date_of_birth of that batch. Given what I’ve shown, how can I do this?
Group on the date and sort on the count to get the most common date: