SQL - Postgreslq 10 Is there a method to restrict going back in selected views?

 
Vista:
sin imagen de perfil
Val: 5
Ha disminuido su posición en 15 puestos en SQL (en relación al último mes)
Gráfica de SQL

Postgreslq 10 Is there a method to restrict going back in selected views?

Publicado por jorge (2 intervenciones) el 29/09/2020 02:42:29
I have 3 tables, one of which "tmp" feeds the other 2 tables. First run "upsert", all good. But the "cod_person" variant is unique in the "tmp and driver" tables, so I did a "SELECT" which will show the one that "NOT" is in the "driver" table, which "I think" is fine, but I don't understand why what the new record is entered in the "driver_false" table, since it should be the last one that was in the driver table, since "cod_person" are unique in "tmp and driver". And what I want to do is "Insert" the different value as it appears in the "SELECT <>", and then delete it from the "driver" table. ¿Could you tell me what would be the most suitable function in this case? Am I misunderstanding any concept? Is it the syntax?
Please *** DEMO: **** https://dbfiddle.uk/?rdbms=postgres_10&fiddle=656e395f1bb0c3b820ef42061d0ca742
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil
Val: 5
Ha disminuido su posición en 15 puestos en SQL (en relación al último mes)
Gráfica de SQL

Postgreslq 10 Trigger Correct syntax or IF between 3 tables

Publicado por jorge (2 intervenciones) el 29/09/2020 13:49:00
I have 3 tables, one of which "tmp" feeds the other 2 tables. First run "upsert", all good. But the "cod_person" variant is unique in the "tmp and driver" tables, so I did a "SELECT" which will show the one that "NOT" is in the "driver" table, which "I think" is fine, but I don't understand why what the new record is entered in the "driver_false" table, since it should be the last one that was in the driver table, since "cod_person" are unique in "tmp and driver". And what I want to do is "Insert" the different value as it appears in the "SELECT <>", and then delete it from the "driver" table. ¿Could you tell me what would be the most suitable function in this case? Am I misunderstanding any concept? Is it the syntax?
Please *** DEMO: **** https://dbfiddle.uk/?rdbms=postgres_10&fiddle=656e395f1bb0c3b820ef42061d0ca742
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar