Questions tagged [sql-delete]

The SQL DELETE statement allows you to delete a single row or multiple rows from a SQL table.

The DELETE statement removes one or more rows from a table. A subset may be defined for deletion using a condition, otherwise all rows are removed. Some DBMSs, like MySQL, allow to delete rows from multiple tables with one DELETE statement (this is sometimes called multi-table DELETE).

Use this tag instead of which is too broad.

Reference

3082 questions
0
votes
1 answer

How to turn this code in to a sql delete function?

I was wondering how I could go about turning this add entry link in to a delete entry link? Any help would be appreciated. if (CAN_EDIT){ echo ''.$announcements[$x]['page_edit']='
Nicole
  • 217
  • 2
  • 7
0
votes
3 answers

Deleting rows using a limit and offset without using IN clause

I want to delete rows with an offset, so I am forced to use a nested query since its not support in the raw DELETE clause. I know this would worked (ID is the primary key): DELETE FROM customers WHERE ID IN ( SELECT ID FROM customers …
Paul Shan
  • 63
  • 1
  • 8
0
votes
0 answers

Jpa No entity found for query

Does anybody know why I get this error? As far as I know, the query is correct. The error reads org.springframework.dao.EmptyResultDataAccessException: No entity found for query; even after continuously changing the code in both my Repository and…
Soufghalb
  • 13
  • 7
0
votes
1 answer

How to delete Sqlite rows that contain old data for the same field but with different timestamps?

I have a unique situation. I haven't found a similar question yet. Here's the table I have. TIMESTAMP SYMBOL NAME PRICE YEAR-LOW YEAR-HIGH STATEMENT-DATE 2022-06-12 17:32:37.117340 AOS A. O. Smith Corporation 58.06 …
Zac1
  • 208
  • 7
  • 34
0
votes
1 answer

Deleting a row from joined tables using group by and having clauses

I want to delete a row from both table (enrol, course) if there are less than 3 enrolees of that course. DELETE enrol, course FROM enrol INNER JOIN course ON enrol.course_id = course.id WHERE enrol.course_id in (SELECT enrol.course_id group by…
Jadey
  • 49
  • 6
0
votes
1 answer

Deletion from huge table which does not have index created on it

I've a table with 230 million records and from this table I need to delete 300 records everyday on the basis of some condition. Now, this table does not have index created on it. To delete 300 records I've created a job which does deletion part.…
0
votes
1 answer

Delete all entries in 5 minute interval, but prevent entries on start and end in interval

I have a 400GB table where a new entry will be added every 2 seconds. This table holds event states for microchips. I have a created_at Datetime field and a topic String field to determine the event state. My task is now to delete all idle events in…
Tanktiger
  • 80
  • 1
  • 12
0
votes
1 answer

How to fix confirm delete not working in codeigniter, ajax?

what am I missing? after "ok" in "are you sure you want to delete", I get nothing. But when i try to alert $id it works. Is it ajax problem? I have this in my footer.php