0
I have a table Paciente
mysql, in it I have the column id
, nome
, numeroProntuario
etc. This column numeroProntuario
is defined by the increment of +1 resulting from select max(numeroProntuario)
(legacy code, don’t judge me).
Now, I’m implementing a waiting list, and I’m integrating with this table, and as I noticed this problem, I thought I’d use the same id number on the chart number. But I haven’t found anything in that direction and I still can’t change the previous records.
Does anyone have any idea how I fix this, or has no fix and better play it anyway?
Patient Table:
id numeroProntuario nome
5565 5548 ANA
5566 5549 PRISCILA
5567 5550 MIRIAN
5568 5551 ALEXANDRE
5569 5552 JACONIAS
5570 5553 KASSIO
5571 5554 KEROLY
5572 5555 ALEX
You want to stop using select max(numeroProntuario)+1?
– Eduardo dos S Barbieri
I think this is bad practice, so if possible yes. I would like to fix this
– cpll