0

I'm trying to convert the query FROM MYSQL TO MSSQL. MYSQL QUERY:

 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 QUERY:

   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

If I've limit x,y in MYSQL means I will use BETWEEN x and y in MSSQL. But x,y is dynamically append when my java code is running. The Query have only upto LIMIT in MYSQL, then how can I modify the query into MSSQL.

Mahesh
  • 8,694
  • 2
  • 32
  • 53
user3114967
  • 639
  • 5
  • 15
  • 38

0 Answers0