Forum > Databases

[SOLVED] SQLite delete a record with no visible ID

(1/2) > >>

Pe3s:
Hello forum members, we have a database: id, Name, Surname, Age, City.
we ask 'SELECT Name, Surname, Age, City FROM table'. How can you, for example, delete a record if we do not have access to id?

rvk:
You can delete with a more elaborate WHERE clause like
delete from table where name:='a' and surname:='b' and etc.
But you risk deleting possible duplicates of people with the same name and age in the same city (this could happen).

But why don't you have access to the ID?
You should always include it.
You could hide it from grids but it should be there.

af0815:
Not to have the PK is a design fault.

Pe3s:
there is an id in the project, but I don't want to see it in the table

Thaddy:

--- Quote from: af0815 on September 25, 2022, 05:51:36 pm ---Not to have the PK is a design fault.

--- End quote ---
And a big one.

Navigation

[0] Message Index

[#] Next page

Go to full version