|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
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 appreciated. Lee G. Note: See my try at the subqyery at the very bottom of the page. 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 |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > subquery help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|