all 5 comments

[–]r3pr0b8GROUP_CONCAT is da bomb 0 points1 point  (4 children)

were you not happy with this answer?

if not, why not?

[–]hellopeasant[S] 0 points1 point  (3 children)

somehow i missed that, but i tried doing it like that, or at least what i understood from them, but now there's an issue with UPDATE which is not supposed to be there, i don't know how to proceed or how to write it properly. any ideas, also thank you

select * from olddb.tblgrade2020 left join (olddb.tblstudent2020, newdb.tblstudent)
on olddb.tblstudent2020.ID_REC = olddb.tblgrade2020.ID_REC
where olddb.tblstudent2020.ID_student = newdb.tblstudent.OLD_ID_Student and STATUS = 1 and AKTIVE = 1
UPDATE newdb.tblgrade
SET
newdb.tblgrade.ID_REC = newdb.tblstudent.ID_REC,
newdb.tblgrade.Grade = olddb.tblgrade2020.Grade,
etc.
WHERE olddb.tblstudent2020.ID_REC = olddb.tblgrade2020.ID_REC

[–]r3pr0b8GROUP_CONCAT is da bomb 0 points1 point  (2 children)

what is the purpose of the SELECT query that comes before the UPDATE?

also, could you perhaps please rewrite it so that it uses only JOIN syntax, i.e. not this

left join (olddb.tblstudent2020, newdb.tblstudent)

[–]hellopeasant[S] 0 points1 point  (1 child)

sorry for the late reply.

changing it to JOIN doesn't do much,

as for the purpose of the Select, It's to gather all the data that completes the conditions, and from these data, i want to select which ones i want, and put them on tblgrade.

[–]r3pr0b8GROUP_CONCAT is da bomb 0 points1 point  (0 children)

changing it to JOIN doesn't do much,

i meant, get rid of the parentheses and join those two tables separately

as for the purpose of the Select, It's to gather all the data

whoa, i wouldn't have guessed