Help for this page

Select Code to Download


  1. or download this
    my $fields = join "||'|'||", qw( field1, field2, field3);
    my %set1 = map { $_ => 1 }
      get_records ( "SELECT $fields FROM table WHERE data_set = 'set1'");
    ...
    
    my @set2not1 = grep { ! exists($set1{$_}) } keys %set2;
    my @set1not2 = grep { ! exists($set2{$_}) } keys %set1;
    
  2. or download this
    CREATE VIEW set1 AS
      SELECT field1,field2,field3 FROM table WHERE data_set = 'set1';
    CREATE VIEW set2 AS
      SELECT field1,field2,field3 FROM table WHERE data_set = 'set2';