<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:12pt"><div><span>First, you don't have to convert a SELECT query.</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br><font color="#808080"><font color="#808080"><font style="BACKGROUND-COLOR:#ccffff;" color="#000000">$query-&gt;condition('us.uid' , $user-&gt;uid);</font></font></font></div><div>&nbsp;</div><div><font size="4" color="#ff007f" face="bookman old style, new york, times, serif"><i><b>Nancy</b></i></font> <br></div><div><font face="arial, helvetica, sans-serif">Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.</font></div><div><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; margin-top: 5px; padding-left: 5px;">  <div style="font-family: arial, helvetica, sans-serif;
 font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> Kamal Palei &lt;palei.kamal@gmail.com&gt;<br> <b><span style="font-weight: bold;">To:</span></b> support@drupal.org <br> <b><span style="font-weight: bold;">Sent:</span></b> Friday, September 21, 2012 1:14 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> [support] D7 Sql USING syntax<br> </font> </div> <br><div id="yiv1384116292"><div>Hi All</div>
<div>I am trying to write a sql query in D7.</div>
<div>&nbsp;</div>
<div><font color="#808080"><font color="#808080">
<div><font color="#000000">SELECT id, exp, name FROM {resubmt_users_skills} LEFT JOIN {resubmt_skill_ids} USING (id) WHERE resubmt_users_skills.uid = $user.uid</font></div>
<div><font color="#000000">The above query I want to write in D7.</font></div>
<div><font style="BACKGROUND-COLOR:#ccffff;" color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $query = db_select('resubmt_users_skills' , 'us');<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $query-&gt;leftJoin('resubmt_skill_ids' , 'si');<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $query-&gt;condition('USING(id)');<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $query-&gt;condition('us.uid = :uid' , array(':uid' =&gt; $user-&gt;uid));<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $result = $query-&gt;execute()-&gt;fetchAssoc();<br></font></div>
<div><font color="#000000">&nbsp;Looks above syntaxt is not correct. Can somebody pls tell me whats the fault here and solution for that.</font></div>
<div><font color="#000000"></font>&nbsp;</div>
<div><font color="#000000">Thanks</font></div>
<div><font color="#000000">Kamal</font></div>
<div><font color="#000000"></font>&nbsp;</div>
<div><font color="#000000">&nbsp;</font></div></font></font></div>
</div><br>-- <br>[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br><br> </div> </div> </blockquote></div>   </div></body></html>