my @ips = $c->dbic_log->resultset('login_history')->search( {
   }, {
       select => [
           { distinct => [ 'user_id','IP' ] }
       ],
       as => [ 'user_id','IP' ]
   }
   )->all;

will create SQL:

DBD::mysql::st execute failed: Operand should contain 1 column(s) [for Statement "SELECT DISTINCT( user_id, IP ) FROM login_history me"]

which in mysql:
mysql>  SELECT DISTINCT( user_id, IP ) FROM login_history limit 1;
ERROR 1241 (21000): Operand should contain 1 column(s)
mysql>  SELECT DISTINCT user_id, IP FROM login_history limit 1;
+---------+----------------+
| user_id | IP             |
+---------+----------------+
| 15538534 | 220.238.87.172 |
+---------+----------------+
1 row in set (0.18 sec)

with (), mysql will complaint.  version is 5.0.24a.

any hint? Thanks.

--
Fayland Lam // http://www.fayland.org/ Foorum based on Catalyst // http://www.foorumbbs.com/

_______________________________________________
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