[development] SQL Query Doubt

Jason Flatt drupal at oadaeh.net
Sat Apr 16 11:24:35 UTC 2011


On Sat, 16 Apr 2011 16:09:59 +0530
Austin Einter <austin.einter at gmail.com> 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/


More information about the development mailing list