469,307 Members | 2,482 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,307 developers. It's quick & easy.

subquery help

I tried what's below, seemed OK, so I replaced an "IN" for the "=" in
the subquery below because of the subquery's error message. I thought
w/"IN" I'd get three (3) records returned as expected. But when I tried
"IN" I got my entire DB returned - I don't show that below - it kept
scrolling so I aborted it. What did I do wrong? Seems like the inner
just returns three recs. and should match-up w/the outer for three recs.
too. I'm using 4.1. Thanks, any help arrpeciated. Lee G.
mysql> SELECT access_no FROM balloon_txt WHERE MATCH
(access_no,recs_txt) AGAINST ('robin');
+------------+
| access_no |
+------------+
| BT-1037.11 |
| BT-2540 |
| BT-1034.06 |
+------------+
3 rows in set (0.01 sec)

mysql> SELECT * FROM balloon_rec WHERE access_no='BT-1034.06';
+------------+--------------------------------------------+----------------+------------+-------------------------------------------------------------------+
| access_no | title | author
| doc_date | elec_access
|
+------------+--------------------------------------------+----------------+------------+-------------------------------------------------------------------+
| BT-1034.06 | Status of Meteorological Sounding Balloons | Robert
Leviton | 1963-12-01 |
http://Databases/Balloon/Data/BT1034.06.pdf |
+------------+--------------------------------------------+----------------+------------+-------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> SELECT * FROM balloon_rec WHERE access_no=(SELECT access_no FROM
balloon_txt WHERE MATCH (access_no,recs_txt) AGAINST ('robin'));
ERROR 1242 (21000): Subquery returns more than 1 row
Jul 20 '05 #1
0 1421

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by leegold2 | last post: by
6 posts views Thread by phillip.s.powell | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.