SELECT t13_Literature_Material_Codes.Databank, t13_Literature_Material_Codes.BASE_NUMB, t13_Literature_Material_Codes.BASE_SYMB, t13_Literature_Material_Codes.BASE_CHAR, t13_Literature_Material_Codes.BASE_MOLW, CorrosionRatesInfo.RatesValidFlag FROM CorrosionRatesInfo RIGHT JOIN t13_Literature_Material_Codes ON CorrosionRatesInfo.BASE_NUMB=t13_Literature_Material_Codes.BASE_NUMB;
如何在sqlite中执行此查询?我看到人们使用左外部连接。请提供一个使用类似结构的解决方案,然后我的c++程序可以用一个简单的解析器过程修改查询字符串。
发布于 2012-08-30 03:34:32
要在Sqlite中执行此查询:
SELECT t13_Literature_Material_Codes.Databank, t13_Literature_Material_Codes.BASE_NUMB, 
t13_Literature_Material_Codes.BASE_SYMB, t13_Literature_Material_Codes.BASE_CHAR, 
t13_Literature_Material_Codes.BASE_MOLW, CorrosionRatesInfo.RatesValidFlag FROM 
CorrosionRatesInfo RIGHT OUTER JOIN t13_Literature_Material_Codes ON  
CorrosionRatesInfo.BASE_NUMB=t13_Literature_Material_Codes.BASE_NUMB;你只需要添加"RIGHT OUTER“。
发布于 2016-06-08 13:48:19
解决这个问题的用户联盟
例如
SELECT employee.*, department.*
FROM   employee 
       LEFT JOIN department 
          ON employee.DepartmentID = department.DepartmentID
UNION ALL
SELECT employee.*, department.*
FROM   department
       LEFT JOIN employee
          ON employee.DepartmentID = department.DepartmentID
WHERE  employee.DepartmentID IS NULL是的,see the example on Wikipedia.
https://stackoverflow.com/questions/12184427
复制相似问题