szabgab has asked for the wisdom of the Perl Monks concerning the following question:
I have some more questions regarding SQL::Abstract.
print $sql->where({ sale => {'==', 1}, rent => {'==', 1}, })
gives
sale == ? AND rent == ?and
print $sql->where([ sale => {'==', 1}, rent => {'==', 1}, ])
gives
sale == 1 OR rent == 1so far it is good. How can I get
city == ? AND (sale == 1 OR rent == 1)Update
A workaround based on a suggestion of merlyn looks like this with a very strange hash key.
print $sql->where({ "(sale==1 OR rent==1) AND city" => {'==', 'Jerusalem'}, }), "\n";
Anyone a cleaner solution ?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: more of SQL::Abstract
by CountZero (Bishop) on Jan 08, 2005 at 13:36 UTC | |
|
switching from SQL::Abstract to SQL::Interpolate
by markjugg (Curate) on Jan 09, 2005 at 03:25 UTC | |
by merlyn (Sage) on Jan 09, 2005 at 04:05 UTC | |
by mrdave (Initiate) on Jan 11, 2005 at 06:44 UTC |