Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Re: [LanceWilson2] Using advanced WHERE SQL statement?

Quote Reply
Re: [LanceWilson2] Using advanced WHERE SQL statement? In reply to
Hi,

GT::SQL does not support for sup-query, but you can do something like this instead:

my $list = $DB->table("Insured")->select('Carrier', { PatientID => 'xxxxxxxxxxx' })->fetchall_arrayref;
my @ids = map $_->[0], @$list;

my $results = $DB->table('Select')->select(GT::SQL::Condition->new(Carriers => 'NOT IN' => \@ids))->fetchall_hashref;
# For debugging
use Data::Dumper;
print "<pre>".Dumper($results)."</pre>";

Hope that helps.

TheStone.

B.
Subject Author Views Date
Thread Using advanced WHERE SQL statement? LanceWilson2 3926 Feb 14, 2005, 12:29 AM
Thread Re: [LanceWilson2] Using advanced WHERE SQL statement?
604 3764 Feb 14, 2005, 1:48 PM
Thread Re: [TheStone] Using advanced WHERE SQL statement?
LanceWilson2 3751 Feb 20, 2005, 9:16 PM
Post Re: [LanceWilson2] Using advanced WHERE SQL statement?
LanceWilson2 3732 Mar 2, 2005, 10:19 AM