MySQL Forums
Forum List  »  Newbie

Help with select statement
Posted by: C Jamieson
Date: May 02, 2005 11:02AM

It's obvious I have only one ore in the water.
I am attempting to select (identify) records from a table where a specific field must equal certain values.
The problem I am having is that all the values must exist before any are to be selected.

For example

FROM `employees`
where Employee_ID = '1035'
and (Skill_Training_Type = 'SKILL1' or Skill_Training_Type = 'SKILL2')

Will select records with either of the values.

FROM `employees`
where Employee_ID = '1035'
and (Skill_Training_Type = 'SKILL1' and Skill_Training_Type = 'SKILL2')

Will select no records - obviously.

I want the select to select the records only if both records exist for the specific Employee_ID.

The statement is being used by a report generator so generating temporary tables and reselecting is not feasible.



Options: ReplyQuote

Written By
Help with select statement
May 02, 2005 11:02AM

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.