TechSpott - Computer and technology forums

Go Back   TechSpott - Computer and technology forums > Webmasters > Database Management > MySQL
MySQL Forum dedicated to the world's most popular open source database engine.

Reply
 
Thread Tools Display Modes
Old April 9th, 2010, 07:29 AM   #1 (permalink)
Rudolph
Guest
 
Posts: n/a
Default How come those two MySQL queries don't return the same results? (IN and EXISTS)?

This one returns no results:

SELECT * FROM we_cr_people p WHERE 'wug' IN (SELECT name FROM we_cr_tags WHERE tableid = '17' AND itemid = p.id) LIMIT 100

This one has three results:

SELECT * FROM we_cr_people p WHERE EXISTS (SELECT * FROM we_cr_tags WHERE tableid = '17' AND itemid = p.id AND name = 'wug') LIMIT 100
  Reply With Quote Share with Facebook
Reply

Bookmarks

Tags
exists, mysql, queries, results, return


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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 On
HTML code is Off


 
Forum Stats
Members: 14,372
Threads: 20,381
Posts: 27,861
Total Online: 52

Newest Member: VanyaDog

Latest Threads

Advertisements

Support our advertisers!

Amazon
Sears
Macys
1800flowers.com
Drugstore.com


Carbonite Online-Backups
Tiger Direct
Tech Depot
Buy.com
Office Depot
Fatcow
HostGator


TripsNow.us
Marriott
Expedia
CheapTickets.com
OneTravel
Hotwire

Are you a Fan?

Share this on Facebook

Tag Cloud

Partner Links


Contact Us - Home - Archive - Privacy Statement - Top - Copyright © 2009-2010, TechSpott - All times are GMT -4. Time is 08:13 PM

Powered by vBulletin® Copyright © Jelsoft Enterprises Ltd. :: SEO by vBSEO