I am building JSP application in which I want to do following operations on specific table
- Display Data
- Delete Data
I’ve done displaying data, however:
How can I delete a row in database if the table does not have any primary key ? (Delete operation does not depends on any value of that row)
Suppose here is may table –>> mytemp
Here is the data
Name | RollNo
ABC | 98
XYZ | 76
ABC | 98
XYZ | 76
There is no key in this table and i want to delete 3 rd record. How can i do this ?
You can choose any available column you think most suitable: e.g.
without column_name you can delete all rows only.
column_namedoes not has to be primary key, but all rows withcolumn_name = 'valuse'will be deleted.EDIT
To delete:
NameandRollNomay not be primary key.Delete only third row:
Second way: if TOP not works
CAUTION: it will delete one, which one I am not sure.Give it a try!!