homepage Welcome to WebmasterWorld Guest from 54.198.33.96
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderators: physics

Databases Forum

    
MySQL WHERE Comparison to Array
TheRealTerry




msg:1578564
 7:29 pm on Dec 28, 2005 (gmt 0)

I want to creat a SQL statement that lets me SELECT recID FROM table WHERE refID!= [any existing values for recID in the current table]

I'm having a hard time figuring out how to compare a column in a where clause to an array from another column. Basically I want to locate orphaned records that used to reference other records that have since been deleted. I tried investigating JOIN statements, both those seem to only apply to data in another table, not the current one. Any ideas for me? Thanks in advance.

 

arran




msg:1578565
 7:39 pm on Dec 28, 2005 (gmt 0)

Something like:

SELECT recID FROM table WHERE refID not in (SELECT refID from...)

arran.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved