Re: [Dbix-class] Newbie from SQL to DBIx

2018-03-08 Thread Andreas Dafferner
Am 08.03.2018 um 12:56 schrieb Matthew Somerville: You could do this: FixMyStreet::DB->resultset("Table")->search({}, { columns => { col => \"left(col, length(col)-9)" }, distinct => 1, order_by => "left(col, length(col)-9)" }); Thank you VERY much!!! Andreas

Re: [Dbix-class] Newbie from SQL to DBIx

2018-03-08 Thread Matthew Somerville
On 8 March 2018 at 06:52, Andreas Dafferner wrote: > select distinct left (col, (length(col) - 9)) from table order by col You could do this: FixMyStreet::DB->resultset("Table")->search({}, { columns => { col => \"left(col, length(col)-9)" },

Re: [Dbix-class] Newbie from SQL to DBIx

2018-03-08 Thread Will Crawford
A visit to https://www.google.co.uk/search?q=dbix+select+distinct should answer your question: DBIx::Class::Manual::Cookbook (first result here) says: SELECT DISTINCT with multiple columns ... my $rs = $schema->resultset('Artist')->search( {}, { columns => [ qw/artist_id name

[Dbix-class] Newbie from SQL to DBIx

2018-03-07 Thread Andreas Dafferner
I'm quite new to DBIx and cannot find out what is the DBIx way for select distinct left (col, (length(col) - 9)) from table order by col ??? Thank you for any help Andreas ___ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: