redRemedy Posted September 13, 2006 Share Posted September 13, 2006 Hi!I am currently evaluating MySQL version 4.1.21. Until now I have only used versions without the support of SubQueries.As my first test I was planning to re-make som existing queries into Sub-queries. So I started with the following query:[code]SELECT p.*FROMs24_event e, s24_event_participant ep, s24_participant pWHEREep.event = $pEventIdAND e.id = ep.eventAND p.id = ep.participant[/code]and I changed it into this:[code]SELECT *FROM s24_participantWHERE id IN(SELECT participantFROM `s24_event_participant`WHERE event = $pEventId)[/code]I should get the same result from these two queries, right?The latter one seems to cayse MySQL to stop responding. WHen I ran it through a PHP-script I got the "Too many connections"-error message. Does anyone have any ideas of what the problem could be?// Jonas Eriksson Link to comment https://forums.phpfreaks.com/topic/20620-subquery-seems-to-hang-mysql/ Share on other sites More sharing options...
fenway Posted September 13, 2006 Share Posted September 13, 2006 Not really sure, though you really should leave it as a join. Link to comment https://forums.phpfreaks.com/topic/20620-subquery-seems-to-hang-mysql/#findComment-91108 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.