Hi,
I have created the following SELECT statement that works perfectly and retrieves the data I want to work with:
SELECT * FROM shoppingbasket
WHERE DateAdded < SUBDATE(NOW(), INTERVAL 30 MINUTE)
AND NOT EXISTS (
SELECT * FROM shoppingbasket newer
WHERE DateAdded >= SUBDATE(NOW(), INTERVAL 30 MINUTE)
AND shoppingbasket.SessionNo = newer.SessionNo)
However, what I want to do is DELETE the data it returns, could someone please help me with this, it's a bit beyond my current SQL skills!
Thanks.
I have created the following SELECT statement that works perfectly and retrieves the data I want to work with:
SELECT * FROM shoppingbasket
WHERE DateAdded < SUBDATE(NOW(), INTERVAL 30 MINUTE)
AND NOT EXISTS (
SELECT * FROM shoppingbasket newer
WHERE DateAdded >= SUBDATE(NOW(), INTERVAL 30 MINUTE)
AND shoppingbasket.SessionNo = newer.SessionNo)
However, what I want to do is DELETE the data it returns, could someone please help me with this, it's a bit beyond my current SQL skills!
Thanks.