I'm trying to delete a row in a table using a sub-query, like as below:
id is a string value & ctime is a timestamp value. So basically the sub-query gets the id value from the row with the oldest timestamp & the first part of the query deletes the row having that id value. My problem is that I don't know how the handle the single quotes that are required around the id value. I can do this using 2 separate queries, but I'd like to combine them into 1 query. Thanks for any help...Code:delete from MyTable where id = '(select id from MyTable order by ctime limit 1)'




Reply With Quote