I have a table
id(PK, AI) name(UQ)
1 mike
2 ashly
3 nash
I want users are able to add new names. But if name
already exists I don't want to add it again, and get the already existing name's id
. If name does not exist I want new id
of new name
I have tried many queries but none of them worked. That's why I am not going to write them here.
Thanks for help.