<br>SELECT EmployeeID FROM {tablename} WHERE Skill IN ( 'PHP', 'Java');<br><br><br><div id="htc_header" style="">----- Reply message -----<br>From: "Austin Einter" <austin.einter@gmail.com><br>To: <development@drupal.org><br>Cc: "Jason Flatt" <drupal@oadaeh.net><br>Subject: [development] SQL Query Doubt<br>Date: Sat, Apr 16, 2011 7:33 am<br><br></div><br><div>Hi</div>
<div>Thanks for reply.</div>
<div> </div>
<div>I have tried SELECT EmployeeID FROM {tablename} WHERE Skill = 'PHP' AND Skill = 'Java'; . It does not work.</div>
<div>Probably in SQL in same row of table both values are not matching.<br></div>
<div>Regards,<br>Austin<br></div>
<div class="gmail_quote">On Sat, Apr 16, 2011 at 4:54 PM, Jason Flatt <span dir="ltr"><<a href="mailto:drupal@oadaeh.net">drupal@oadaeh.net</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div>
<div></div>
<div class="h5">On Sat, 16 Apr 2011 16:09:59 +0530<br>Austin Einter <<a href="mailto:austin.einter@gmail.com">austin.einter@gmail.com</a>> wrote:<br><br>> Hi All<br>><br>> Lets say I have one table in below format.<br>
><br>> EmployeeID.............. Skill<br>> ------------------------------------------------------<br>> 1...............................PHP<br>> 1...............................SQL<br>> 1...............................Java<br>
> 1................................VoIP<br>><br>> 2................................Shell Scripting<br>> 2................................PHP<br>> 2................................Java<br>><br>> 3............................... C++<br>
> 3................................C<br>> 3.................................Pearl<br>><br>> I wan to do a SQL query for employess who MUST have skill PHP and Java.<br>> As per above table, the query result should show Employee 1 and 2.<br>
><br>> Now what should be the corresponding SQL query for it.<br><br></div></div>SELECT EmployeeID FROM {tablename} WHERE Skill = 'PHP' AND Skill = 'Java';<br><br>This might help a bit:<br><a href="http://dev.mysql.com/doc/refman/5.1/en/sql-syntax.html" target="_blank">http://dev.mysql.com/doc/refman/5.1/en/sql-syntax.html</a><br>
<font color="#888888"><br><br>--<br>Jason Flatt<br>Custom Website development solutions: <a href="http://www.oadaeh.net/" target="_blank">http://www.oadaeh.net/</a><br>Father of seven: <a href="http://www.flattfamily.com/" target="_blank">http://www.flattfamily.com/</a> (Joseph, 18; Cramer, 16; Travis,<br>
14; Angela; Harry, 10; William, 5; and Dolly, 2) Linux user:<br><a href="http://www.ubuntu.org/" target="_blank">http://www.ubuntu.org/</a> Android user: <a href="http://www.android.com/" target="_blank">http://www.android.com/</a><br>
Drupal fanatic: <a href="http://drupal.org/" target="_blank">http://drupal.org/</a><br></font></blockquote></div><br>