Sql server 需要将Sybase查询转换为SQL Server 2012
*=和=*样式联接已被删除和 重写您的查询,*=左外连接,=*右外连接。一些来自MS的示例快速指南:Sql server 需要将Sybase查询转换为SQL Server 2012,sql-server,tsql,sql-server-2012,sybase,Sql Server,Tsql,Sql Server 2012,Sybase,*=和=*样式联接已被删除和 重写您的查询,*=左外连接,=*右外连接。一些来自MS的示例快速指南: 另外,从查询中删除`符号 您可以通过将数据库兼容性级别设置为80来运行此操作基本上是外部连接,使用非常非常旧的语法。这只是供参考-您真的应该重写它,您可以看到=*使用LEFT-OUTER-join.yes。重写我的查询后。。我需要sql server中的精确查询。这是“这是我的脚本,修复它”问题之一。问一个具体的问题,自己试一试。转换并不是那么难。@Alex:请注意:SQL Server 201
另外,从查询中删除`符号 您可以通过将数据库兼容性级别设置为80来运行此操作基本上是外部连接,使用非常非常旧的语法。这只是供参考-您真的应该重写它,您可以看到=*使用LEFT-OUTER-join.yes。重写我的查询后。。我需要sql server中的精确查询。这是“这是我的脚本,修复它”问题之一。问一个具体的问题,自己试一试。转换并不是那么难。@Alex:请注意:SQL Server 2012不支持80的兼容级别。
SELECT
gasqlty_cylinder.qualification_date,
gas_qlty_cylinder.location_id,
gas_qlty_lab.lab_desc,
gas_qlty_cylinder.start_date,
gas_qlty_cylinder.end_date,
analysis_data.date_set,
analysis_data.date_removed,
analysis_data.btu,
analysis_data.spec_gvty,
gas_qlty_cylinder.remarks,
gas_qlty_cylinder.mcsusr_id,
gas_qlty_cylinder.trans_timestamp
FROM gasqltycylinder,
analysisdata ,
gasqltylocation,
gasqltylab
WHERE ( gas_qlty_cylinder.cylinder_id *= analysis_data.`cylinder_id` ) and
( gas_qlty_location.location_id = gas_qlty_cylinder.location_id ) and
( gas_qlty_location.lab_id = gas_qlty_lab.lab_id ) and
( analysis_data.analyzed_time =* ( select max(analyzed_time) from analysis_data
where gas_qlty_cylinder.cylinder_id = analysis_data.cylinder_id and
))
Order by cylinder_id