mercredi 16 octobre 2019

Using IF Exists function IN pgadmin3 ERROR: IF IN "previous_date" = null SQL state: 42601 Character: 368

I am trying to execute an SQL statement in pg admin 3 that do the following:

If a student with a specific name and age already exists then get the student_id else insert a new record with the specified name and age and then get the created student_id

I have tried this code:

ERROR: syntax error at or near "IF" LINE 13: IF IN "previous_date" = null ^ SQL state: 42601 Character: 368

Aucun commentaire:

Enregistrer un commentaire