[development] SQL Query Doubt
Robbie The Geek
robbiethegeek at gmail.com
Sat Apr 16 11:47:59 UTC 2011
SELECT EmployeeID FROM {tablename} WHERE Skill IN ( 'PHP', 'Java');
----- Reply message -----
From: "Austin Einter" <austin.einter at gmail.com>
To: <development at drupal.org>
Cc: "Jason Flatt" <drupal at oadaeh.net>
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 <drupal at oadaeh.net> wrote:
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/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20110416/5193196b/attachment.html
More information about the development
mailing list