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 > ERROR 1064 on IN statement

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-28-04, 09:21
kromo kromo is offline
Registered User
 
Join Date: Dec 2003
Posts: 13
ERROR 1064 on IN statement

I would like to get a list of "documents" not locked with this statement
Code:
SELECT F_DOCUMENT_ID FROM T_DOCUMENT WHERE F_DOCUMENT_ID  <> ANY ( SELECT F_DOCUMENT_ID FROM T_DOCUMENT_LOCK )
however I get only this error
Code:
[DB] 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 F_DOCUMENT_ID FROM T_DOCUMENT_LOCK )' at line 1
I looked up the MySQL docs, but it seems to be right...
Anyone a clue?

thanks,
kromo
Reply With Quote
  #2 (permalink)  
Old 01-28-04, 12:36
vanekl vanekl is offline
Registered User
 
Join Date: Nov 2003
Posts: 91
try this,

SELECT f_document_id
FROM t_document d LEFT JOIN t_document_lock c
ON d.f_document_id = c.f_document_id
WHERE c.f_document_id IS NULL

what version of MySQL are you using?
only versions 4.1+ are capable of subselects.
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