sql >> Databasteknik >  >> RDS >> Mysql

Sammanfoga två bord utan att returnera oönskad rad

SELECT 
  IssueID, 
  AssignedID, 
  CreatorID, 
  AssignedUser.real_name AS AssignedName, 
  CreatorUser.real_name AS CreatorName
FROM Issues
  LEFT JOIN Users AS AssignedUser
         ON Issues.AssignedID = AssignedUser.UserID
  LEFT JOIN Users AS CreatorUser
         ON Issues.CreatorID = CreatorUser.UserID
ORDER BY `issueid` ASC
LIMIT 0, 30


  1. Hantera ORACLE-undantag

  2. Hur man enkelt exporterar Microsoft Access-data till Excel

  3. CodeIgniter/PHP Active Record ökar inte ett heltal

  4. Kan inte fjärransluta till EC2 MySQL-installation