in reply to Re^2: joining tables with SQL::Abstract
in thread joining tables with SQL::Abstract
It's pretty easy in SQL::Abstract to force an AND situation when you have two (or more) conditions on the same column, just use an arrayref where the first element is '-and'. E.g.:
{ create_date => [-and => {'>=' => $start_date}, {'<=' => $end_date}] }
which produces:
WHERE ( ( ( create_date >= ? ) AND ( create_date <= ? ) ) )
For your case you would use:
{ 'users.userid' => [-and => {'=' => 1000}, \'= drivers.userid'] }
which produces:
WHERE ( ( ( users.userid = ? ) AND ( users.userid = drivers.userid ) + ) )
HTH,
Larry
|
|---|