Can you please send the URL to duplicate function if it is explained in D.O<br><br><div class="gmail_quote">On Tue, Dec 20, 2011 at 9:09 AM, Steve Edwards <span dir="ltr"><<a href="mailto:killshot91@gmail.com">killshot91@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm attempting to write DBTNG query for a Migrate v2 class (D6), and I can't quote get a WHERE clause using IN to work. Here's the query I need:<br>
<br>
select ngeuu.user_name, ngeu.email_address1<br>
from nge_users ngeu inner join nge_user_to_group_tbl ngeutg<br>
on ngeu.user_id = ngeutg.user_id<br>
where ngeutg.usergroup_id IN (16, 5608, 48, 34, 22, 26, 24, 18, 28, 20, 14, 12, 6879, 36);<br>
<br>
This query returns the appropriate amount of rows. The way I have the query written in my Migrate class is:<br>
<br>
$query = db_select('nge_users', 'ngeu');<br>
$query->innerJoin('nge_user_to_group_tbl', 'ngeutg', 'ngeu.user_id=ngeutg.user_id');<br>
$query->fields('ngeu', array('user_name', 'email_address1'))<br>
$query->condition('ngeutg.user_id', array(16, 5608, 48, 34, 22, 26, 24, 18, 28, 20, 14, 12, 6879, 36), 'IN');<br>
$query->duplicate();<br>
<br>
but I start getting duplicate rows after 4 records, even though the query by itself doesn't return any. How do I need to change this to make it correct?<br>
<br>
Thanks.<br>
<span class="HOEnZb"><font color="#888888"><br>
Steve<br>
--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Regards,<br>Vaibhav Jain<br>