try..
.select([ :"foo.*", :"bar.baz".AS(:bar_baz) ])

is that what you meant?


I often have to do queries like this when making lots of joins.

I guessed at this syntax, but haven't really thought if this is the right
way?



On 05/02/2008, Kiko Uehara <[EMAIL PROTECTED]> wrote:
>
>
> Hi all,
> I'm trying to generate simple SQL as following, but can't figure out
> the way to specify foo.* in sequel.
> "SELECT foo.*, bar.baz AS bar_baz.."
>
> My (failed) attempts are..
> .select(:foo.*, bar__baz => :bar_baz)
> => method missing * for :foo symbol.
>
> .select('foo.*', bar__baz => :bar_baz)
> => SELECT 'foo.*', bar.baz AS bar_baz...
>
> Here's the actual code:
> Product.join(:categories, :id =>
> category_id).select(:products.*, :categories__name => :category_name)
>
> Any suggestions are greatly appreciated.
> Thanks,
> -kiko
> >
>


-- 




Chris Farmiloe


web: www.oxdi.eu
direct: 01273 782909
skype: chrisfarms

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to