Ignore:
Timestamp:
08/06/08 16:52:46 (16 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/datacenter/db/builddatasets.php

    r8868 r9106  
    6868        $query0 .= " FROM " . $fromtable;
    6969
    70         $query0 .= " LEFT JOIN SequenceProcessStatus ON Sequences.fSequenceFirst=SequenceProcessStatus.fSequenceFirst ";
    71         $query0 .= " LEFT JOIN Calibration ON Sequences.fSequenceFirst=Calibration.fSequenceFirst ";
    72         $query0 .= " LEFT JOIN Star ON Sequences.fSequenceFirst=Star.fSequenceFirst ";
     70        $query0 .= " LEFT JOIN SequenceProcessStatus USING(fSequenceFirst,fTelescopeNumber) ";
     71        $query0 .= " LEFT JOIN Calibration USING(fSequenceFirst,fTelescopeNumber) ";
     72        $query0 .= " LEFT JOIN Star USING(fSequenceFirst,fTelescopeNumber) ";
    7373
    7474        foreach ($_GET as $key => $element)
     
    7979        {
    8080            if ($_GET["fSourceName"]!="On")
    81                 $query0 .= " LEFT JOIN Source ON Sequences.fSourceKEY=Source.fSourceKEY ";
     81                $query0 .= " LEFT JOIN Source USING(fSourceKEY) ";
    8282            $query0 .= " WHERE fTest='no'";
    8383        }
     
    479479                        $query.=", " . $name;
    480480                    $query.=" FROM Sequences ";
    481                     $query.=" LEFT JOIN Calibration ON Calibration.fSequenceFirst=Sequences.fSequenceFirst ";
    482                     $query.=" LEFT JOIN Star ON Star.fSequenceFirst=Sequences.fSequenceFirst ";
     481                    $query.=" LEFT JOIN Calibration USING(fSequenceFirst,fTelescopeNumber) ";
     482                    $query.=" LEFT JOIN Star USING(fSequenceFirst,fTelescopeNumber) ";
    483483                    $query.=" WHERE Sequences.fSequenceFirst IN (" . $sequences . ")";
    484484                    $result = mysql_query($query, $db_id);
     
    501501                function GetSources($db_id, $sequences)
    502502                {
    503                     $query="SELECT fSourceName FROM Source LEFT JOIN Sequences ON Sequences.fSourceKEY=Source.fSourceKEY ";
     503                    $query="SELECT fSourceName FROM Source LEFT JOIN Sequences USING(fSourceKEY) ";
    504504                    $query.="WHERE fSequenceFirst IN (" . $sequences . ") GROUP BY fSourceName";
    505505                    $result = mysql_query($query, $db_id);
Note: See TracChangeset for help on using the changeset viewer.