Convert sql to yii framework.

Hello community, I have this sql code and I would like to know how it can be translated into the yii framework.

INSERT INTOapp_user_pruub(cedula, nombre, apellido) SELECT CAMPO01 As cedula,CONCAT( CONCAT(CAMPO02,’ ‘), CAMPO03) As nombre, CONCAT( CONCAT(CAMPO04,’ '), CAMPO05) As apellido FROM app_employees WHERE 1

thanks!

Query builder doesn’t support INSERT INTO ... SELECT so you have to form query yourself.

Thank you very much for the information.

You know how I could make a code that detects duplicates in a table, copy them to another table and then delete them? Thank you!

It depends very much on what is duplicate.

I have an identification number and I want to know if that same number is in other rows of the same column.

If you have three rows with the same ID, which one of the three you’d keep?