Leser: 2
2 Einträge, 1 Seite |
SELECT * FROM users WHERE datum > FUNKTION AND datum = ANDERE_FUNKTION()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#!/usr/bin/perl use strict; use warnings; use SQL::Abstract; my $sql = new SQL::Abstract; my ($stmt, @bind) = $sql->select('users', '*', { -and => [ datum => {'>' => 'FUNKTION()' }, datum => {'=' => 'ANDERE_FUNKTION()' } ] } ); print $stmt, "\n"; print @bind,"\n";
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#!/usr/bin/perl use strict; use warnings; use SQL::Abstract; my $sql = SQL::Abstract->new; my %where = (); my @sql_interval = ( 'birthday', \'> DATE_SUB(CURDATE(), INTERVAL 20 YEAR)' ); push @sql_interval, ('birthday', \'< BLABLA()'); $where{-and} = \@sql_interval; my ($stmt, @bind) = $sql->select('defaultusers', 'birthday', \%where); print $stmt, "\n";
2 Einträge, 1 Seite |