All pastes #38003 Raw Edit

Anonymous

public text v1 · immutable
#38003 ·published 2006-01-22 14:16 UTC
rendered paste body
mysql> select invid from stockinvoiceitems where partid='1';
+-------+
| invid |
+-------+
|    31 |
+-------+
1 row in set (0.00 sec)

mysql> select * from stockinvoice where id IN ('31','32');
+----+------------+---------+-------+----------+------------+
| id | supplierid | invoice | gst   | shipping | date       |
+----+------------+---------+-------+----------+------------+
| 31 |        323 | 255320  | 60.86 |       10 | 1121313600 |
| 32 |        319 | 1160967 | 42.37 |    33.32 | 1122264000 |
+----+------------+---------+-------+----------+------------+
2 rows in set (0.07 sec)

mysql> select * from stockinvoice where id IN (SELECT invid FROM stockinvoiceitems WHERE partid='1');
ERROR 1064: You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT invid FROM stockinvoiceitems WHERE partid='1')' at line