Gossamer Forum
Home : Products : Gossamer Links : Discussions :

SELECT FROM with IN

Quote Reply
SELECT FROM with IN
my $variable = "12,23,34";
my $variable = "'12','23','34'";
my $variable = "['12','23','34']";
my $variable = "(12,23,34)";
my $variable = "('12','23','34')";

I tried all of them for that:

my $all_db = $DB->table('Links');

$all_db->select_options ("ORDER BY Contact_Name", "");

my $sth = $all_db->select ( ['ID','Title','aLogo','Contact_Name','Hits'],
GT::SQL::Condition->new (
ID => IN => $variable
) );
while (my ($id,$title,$logo,$name,$hits) = $sth->fetchrow_array) {
...

I stuck with passing IDs to this SQL. Anyone here with help, please?
Subject Author Views Date
Thread SELECT FROM with IN Robert 3533 May 3, 2014, 2:32 PM
Thread Re: [Robert] SELECT FROM with IN
Robert 3447 May 3, 2014, 3:14 PM
Thread Re: [Robert] SELECT FROM with IN
Robert 3444 May 3, 2014, 4:25 PM
Post Re: [Robert] SELECT FROM with IN
Andy 3383 May 3, 2014, 11:01 PM