我正在尝试将查询转换为 FROM MYSQL
TO MSSQL
。MYSQL查询:
SELECT DISTINCT a.tc_id
FROM mnrelease_details a,
tc_details b
WHERE a.tc_id=b.tc_name
AND tester IS NULL
AND release_name=?
AND tenv_id=?
AND env_id=?
AND tst_type=? AND a.project=b.project
AND a.project=?
ORDER BY tc_priority LIMIT"
MSSQL 查询:
SELECT *
from
(
select
DISTINCT ROW_NUMBER() OVER (ORDER BY b.tc_priority ) AS row,
a.tc_id
from
release_details a,
tc_details b
where
a.tc_id=b.tc_name
and tst_system is null
and release_name='sdkfei'
and tenv_id='32'
and env_id='32'
and tst_type='21'
and b.autotech='ITL'
and a.project=b.project
and a.project='JupiterQA'
and depclosed=1) AS tab12
WHERE
row BETWEEN
如果我在 MYSQL 中有 limit x
,则意味着我将在 MSSQL 中使用and 。但是,是在我的 java 代码运行时动态附加的。查询只有在MYSQL中,那么我怎样才能将查询修改为MSSQL。y
BETWEEN
x
y
x
y
LIMIT