MySQL Forums
Forum List  »  New in 4.1: Subqueries

Subqueries using the same source table
Posted by: Paul Hempsall
Date: February 10, 2005 02:36PM

Hi all,

I am a fairly new user to MySQL and database programming in general.

I have written a search engine that compiles an SQL statement based on selected parameters that works great in Access. Now I need to move it to MySQL for an online application.

My problem is that often get SQL statements with subqueries sourcing the same table.

e.g.

SELECT dataID FROM data WHERE data.Name NOT LIKE '???'
AND dataID IN (SELECT dataID FROM data WHERE data.Class LIKE 'arm' OR data.Class LIKE 'hand' OR data.Class LIKE 'fist' )

Is there a way to do this in MySQL without creating endless copies of the original table with different names?

Options: ReplyQuote


Subject
Views
Written By
Posted
Subqueries using the same source table
8662
February 10, 2005 02:36PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.