- my $sql = "SELECT * FROM $table "; # join(',', @cols). " FROM $table ".
- $sql .= 'LEFT JOIN '. $args{status_table}.
- ' USING ( '. $args{primary_key}. ' )'
- if $args{status_table};
+ my $sql = "SELECT $table.* FROM $table "; # join(',', @cols). " FROM $table ".
+ $sql .= 'LEFT JOIN '. $status_table.
+ " ON ( $table.$pkey = ". $status_table. ".$pkey )"
+ if $status_table;