Hi jvilla, I know that MySQL supports some simple nested queries from 3.23 -xx, and even includes subselects from 4.1.
However I am not clear if any of the 2 queries will work straight away in 4.1 (once its stable). Best regards Nils Valentin Tokyo/Japan 2003年 7月 9日 水曜日 21:00、Jonathan Villa さんは書きました: > I have a shopping cart which creates temporary tables in the format of > zorder_<phpsessionid>; > > These tables are used to hold a customers order while they shop and > after checking out, it is dropped. The values of the shopping cart are > put together in an HTML table and stored as their history. > > What I want to do is to run a cron job to delete the orders which were > left undone once a day at about midnight. Here is my current query > > SELECT table_name FROM orders WHERE RIGHT(started,8) < RIGHT(NOW(),8) > AND completed < 1 AND LEFT(started,10) = LEFT(NOW(),10); > > I was hoping to do something like this: > > DROP TABLE (SELECT table_name FROM orders WHERE RIGHT(started,8) < > RIGHT(NOW(),8) AND completed < 1 AND LEFT(started,10) = LEFT(NOW(),10)); > > But from my understanding, MySQL does not support nested queries. > > Is there a query-based way to do this... -- --- Valentin Nils Internet Technology E-Mail: [EMAIL PROTECTED] URL: http://www.knowd.co.jp Personal URL: http://www.knowd.co.jp/staff/nils -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]