Hi Andrew,
If you carefully looked at that page, you'd see that MySQL doesn't support
nested queries with a couple exceptions and that the query you are trying to
run wouldn't work in MySQL. The bottom half of the page is dedicated for the
workarounds for your problem.

Gurhan

-----Original Message-----
From: Andrew Wax [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 29, 2002 10:33 PM
To: [EMAIL PROTECTED]
Cc: Victoria Reznichenko
Subject: Follow-up DELETE ISSUE


Victoria, et. al,

Thank you very much for the leads.  I looked at the section in the manual
and still have a few questions (I have added some more info which might
help).

As a reminder my problem was ...

> AW> I have a DELETE statement:
> AW>  delete bond_master,bond_data  from bond_data where
> AW> bond_master.cusip=bond_data.cusip and  bond_master.maturity <=
"2002/02/15";
>
>
> If you use 3.23.X, you can find solution of your problem in the manual:
>     http://www.mysql.com/doc/A/N/ANSI_diff_Sub-selects.html

First of all I am running... server version: 3.23.47-nt

Descriptions of the tables are listed below.
 Table 1:  Bond_master

Goal is to delete records from bond_data based on criteria related to
bond_master (link field is cusip)
I tried the following statement

mysql> select * from bond_data where cusip IN (select cusip from
bond_master);
ERROR 1064: You have an error in your SQL syntax near 'select cusip from
bond_master)' at line 1


Any help would be appreciated.

Andrew
mysql> describe bond_master;
+-------------+----------+------+-----+---------+-------+
| Field       | Type     | Null | Key | Default | Extra |
+-------------+----------+------+-----+---------+-------+
| cusip       | char(10) |      | PRI |         |       |
| description | char(40) | YES  |     | NULL    |       |
| maturity    | date     | YES  |     | NULL    |       |
| sector0     | char(50) | YES  |     | NULL    |       |
| sector1     | char(50) | YES  |     | NULL    |       |
| rating      | char(5)  | YES  |     | NULL    |       |
+-------------+----------+------+-----+---------+-------+
6 rows in set (0.39 sec)


and bond_data:

mysql> describe bond_data;
+-------+----------+------+-----+------------+-------+
| Field | Type     | Null | Key | Default    | Extra |
+-------+----------+------+-----+------------+-------+
| cusip | char(10) |      | PRI |            |       |
| date  | date     |      | PRI | 0000-00-00 |       |
| delta | float    | YES  |     | NULL       |       |
+-------+----------+------+-----+------------+-------+
3 rows in set (0.11 sec)



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to