SELECT EmployeeID FROM {tablename} WHERE Skill IN ( 'PHP', 'Java');

----- Reply message -----
From: "Austin Einter" <[email protected]>
To: <[email protected]>
Cc: "Jason Flatt" <[email protected]>
Subject: [development] SQL Query Doubt
Date: Sat, Apr 16, 2011 7:33 am
Hi
Thanks for reply.
 
I  have tried SELECT EmployeeID FROM {tablename} WHERE Skill = 'PHP' AND Skill 
= 'Java';  .  It does not work.
Probably in SQL in same row of table both values are not matching.

Regards,
Austin

On Sat, Apr 16, 2011 at 4:54 PM, Jason Flatt <[email protected]> wrote:




On Sat, 16 Apr 2011 16:09:59 +0530
Austin Einter <[email protected]> wrote:

> Hi All
>
> Lets say I have one table in below format.

>
> EmployeeID.............. Skill
> ------------------------------------------------------
> 1...............................PHP
> 1...............................SQL
> 1...............................Java

> 1................................VoIP
>
> 2................................Shell Scripting
> 2................................PHP
> 2................................Java
>
> 3............................... C++

> 3................................C
> 3.................................Pearl
>
> I wan to do a SQL query for employess who MUST have skill PHP and Java.
> As per above table, the query result should show Employee 1 and 2.

>
> Now what should be the corresponding SQL query for it.

SELECT EmployeeID FROM {tablename} WHERE Skill = 'PHP' AND Skill = 'Java';

This might help a bit:
http://dev.mysql.com/doc/refman/5.1/en/sql-syntax.html



--
Jason Flatt
Custom Website development solutions: http://www.oadaeh.net/
Father of seven: http://www.flattfamily.com/ (Joseph, 18; Cramer, 16; Travis,

14; Angela; Harry, 10; William, 5; and Dolly, 2) Linux user:
http://www.ubuntu.org/ Android user: http://www.android.com/

Drupal fanatic: http://drupal.org/

Reply via email to