On Monday, August 12, 2019 at 12:02:00 AM UTC-7, Greg Gilbert wrote:
>
> Hey,
>
> Quick question for MySQL: suppose I have a query where I'm doing 
> associated joins, and I want to query by an id on the original table:
>
> items = Item.select_all(:items)
>> items = items.association_join(:item_detail)
>>
>
> Now if I want to do .where(id: [1,2,3]), I get a "Column 'id' in where 
> clause is ambiguous" error.
>
> Trying to use the Sequel qualified identifier doesn't work either:
>
> items = items.where(Sequel[:items][:id]: [1,2,3])
>>
>  
>
Any ideas?
>
 
Your second example should work, it is just not valid syntax, since the key 
is not a symbol.  Try:

  items = items.where(Sequel[:items][:id] => [1,2,3])

Thanks,
Jeremy

>

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/6453f37d-7548-4ab3-bc13-841610442614%40googlegroups.com.

Reply via email to