Christian Lackas wrote:
> Hi Everbody,
> 
> I have trouble formulating this raw SQL in DBIx::Class:
> 
>     SELECT publiclinks.*, COUNT(publicdownloads.id) AS downloadcount
>     FROM publiclinks, publicdownloads 
>     WHERE publicdownloads.linkid = publiclinks.id 
>     GROUP BY publiclinks.id;
> 
> with publiclinks storing a list of resources, which can be downloaded.
> This is logged into publicdownloads and my goal is to get a joined table, 
> which
> additionally shows me how often each resources was requested.
> 
> <snip>
> 
> Why is the '+as' not applied here? And is this the right approach?
> 

http://search.cpan.org/~ribasushi/DBIx-Class-0.08103/lib/DBIx/Class/ResultSet.pm#as

Especially pay attention to:
"It has nothing to do with the SQL code SELECT foo AS bar"

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]

Reply via email to