0

Possible Duplicate:
Removing Duplicate row from a table based on one column

I created a table with multiple inner joins from 4 tables but the results brings back duplicate records. Here is code that I am using

  DataSet quotetobepostedlist = DataRepository.Provider.ExecuteDataSet(System.Data.CommandType.Text,
      "Select  tblLoadStop.LoadID
           , tblCustomer.CustomerID
           ,tblLoadMaster.Salesperson
           ,OriginationState
           , DestinationState
           ,LoadRate
      FROM tblLoadMaster 
      INNER JOIN tblLoadSpecifications ON tblLoadSpecifications.LoadID=tblLoadMaster.LoadID  
      INNER JOIN  tblLoadStop ON tblLoadStop.LoadID=tblLoadMaster.LoadID 
      INNER JOIN tblStopLocation ON tblStopLocation.StopLocationID=tblLoadStop.StopLocationID  
      INNER JOIN tblCustomer ON tblCustomer.CustomerID =tblLoadMaster.CustomerID 
      WHERE tblLoadMaster.Phase LIKE '%2%' 
      ORDER BY tblLoadMaster.LoadID DESC;");

This is the result that I get

Load ID   Customer   Salesperson     Origin  Destination     Rate    
13356     FedEx           Alex           Duluth    New York     300
13356     FedEx           Steve          Florida   Kansas       400

I only want the first row to show,

13356     FedEx           Alex           Duluth    New York     300

and remove the bottom row,

13356     FedEx           Steve          Florida   Kansas       400
4

0 回答 0