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
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)" },
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
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: