If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > mysql select error

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-28-05, 08:18
marzipan marzipan is offline
Registered User
 
Join Date: Nov 2005
Posts: 3
Red face mysql select error

hi guys,

i get this sql select

SELECT COUNT(DISTINCT EntrantsEpost) AS Expr1 FROM ENTRIES WHERE (EntrantsEpost IN (SELECT EntrantsEpost FROM ENTRIES WHERE RightOrWrong = 1 GROUP BY EntrantsEpost HAVING COUNT(*) = 24))

to work correctly on mssql 2000, but i just get the following error in mysql


[MySQL][ODBC 3.51 Driver][mysqld-4.0.26-nt]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 EntrantsEpost FROM ENTRIES WHERE RightOrWrong = 1 GROUP

but i don'tsee the error. does anyone have any ideas?

thanks in advance.

marz
Reply With Quote
  #2 (permalink)  
Old 11-28-05, 09:24
felixg felixg is offline
Registered User
 
Join Date: Apr 2005
Location: Lier, Belgium
Posts: 122
Quote:
Originally Posted by marzipan
SELECT COUNT(DISTINCT EntrantsEpost) AS Expr1 FROM ENTRIES WHERE (EntrantsEpost IN (SELECT EntrantsEpost FROM ENTRIES WHERE RightOrWrong = 1 GROUP BY EntrantsEpost HAVING COUNT(*) = 24))

to work correctly on mssql 2000, but i just get the following error in mysql


[MySQL][ODBC 3.51 Driver][mysqld-4.0.26-nt]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 EntrantsEpost FROM ENTRIES WHERE RightOrWrong = 1 GROUP

but i don'tsee the error.
MySQL 4.0.26 does not support subqueries.

--
felix
Reply With Quote
  #3 (permalink)  
Old 11-28-05, 09:55
marzipan marzipan is offline
Registered User
 
Join Date: Nov 2005
Posts: 3
Red face

hi felix,

is there no other way around this? there are around 50 sql selects in the site and they all feature sub queries and i don't know where to start to convert them.


...i'm a bit worried now. i guess its fair to say

Marz
Reply With Quote
  #4 (permalink)  
Old 11-28-05, 10:03
felixg felixg is offline
Registered User
 
Join Date: Apr 2005
Location: Lier, Belgium
Posts: 122
Quote:
Originally Posted by marzipan
is there no other way around this?
If you don't want to rewrite your queries, the only way is to upgrade to at least MySQL 4.1

--
felix
Reply With Quote
  #5 (permalink)  
Old 11-28-05, 10:31
marzipan marzipan is offline
Registered User
 
Join Date: Nov 2005
Posts: 3
thanks felix.

i think we'll need to upgrade.

thanks for helping me out today,....i thought i was going a bit crazy!

Marz
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On