MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 29th, 2006, 06:03 PM
Rithm Rithm is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2006
Posts: 3 Rithm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 31 m 2 sec
Reputation Power: 0
Error #1064

What could be wrong with the following query?

SELECT `album`
FROM `photos`
WHERE `album`
IN (

SELECT `name`
FROM `albums`
)

I get the following error:

#1064 - You have an error in your SQL syntax near 'SELECT `name` FROM `albums` ) LIMIT 0, 30 ' at line 1

Couldn't find an answer anywhere else...

Reply With Quote
  #2  
Old May 30th, 2006, 04:03 PM
Madpawn Madpawn is offline
My beat is correct.
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 339 Madpawn User rank is Private First Class (20 - 50 Reputation Level)Madpawn User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 22 h 3 m 33 sec
Reputation Power: 4
What's your MySQL version?
__________________
"A pawn is the most important piece on the chessboard -- to a pawn"


Reply With Quote
  #3  
Old May 30th, 2006, 05:35 PM
Rithm Rithm is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2006
Posts: 3 Rithm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 31 m 2 sec
Reputation Power: 0
Quote:
Originally Posted by Madpawn
What's your MySQL version?



3.23.58

Reply With Quote
  #4  
Old May 30th, 2006, 05:38 PM
Madpawn Madpawn is offline
My beat is correct.
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 339 Madpawn User rank is Private First Class (20 - 50 Reputation Level)Madpawn User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 22 h 3 m 33 sec
Reputation Power: 4
That's your problem. MySQL doesn't support subqueries until 4.1.

Reply With Quote
  #5  
Old May 30th, 2006, 05:54 PM
Rithm Rithm is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2006
Posts: 3 Rithm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 31 m 2 sec
Reputation Power: 0
Quote:
Originally Posted by Madpawn
That's your problem. MySQL doesn't support subqueries until 4.1.


bugger.

so should i now use 2 queries to obtain the result I would like or is there an other way to get this done?

Reply With Quote
  #6  
Old May 30th, 2006, 05:58 PM
Madpawn Madpawn is offline
My beat is correct.
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 339 Madpawn User rank is Private First Class (20 - 50 Reputation Level)Madpawn User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 22 h 3 m 33 sec
Reputation Power: 4
You can probably use a join, but I'm not entirely sure what you're trying to accomplish. Do you have albums in photos that don't also exist in albums?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > Error #1064


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT