Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7044673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:26:15+00:00 2026-05-28T02:26:15+00:00

SELECT dteRun, CASE WHEN coalesce(nPriorityCode,0) <= 0 THEN 3 ELSE nPriorityCode END AS nPriorityCode,

  • 0
SELECT     dteRun,                 
CASE WHEN coalesce(nPriorityCode,0) <= 0 THEN 3
               ELSE nPriorityCode
               END AS nPriorityCode,
               CASE WHEN sCommand IN ('DiaryWF','XC_Reminder') THEN '*'
               ELSE ''
               END as Alert,
               sParentRef,
               nWorkflowTypeCode,
               sSubjectName,
               sDescription,
               sUniqueRef,
               sUserInfo,
               sUserInfo2   
FROM    AuroraTasksDiaryView ad
    INNER JOIN   UserAuthority
         ON UserAuthority.UserName = ad.sOwningUser
         AND ad.sOwningUser  = 'ammonsd'  AND  ad. nErrorCode = -1
         AND ad.sExcludedUser <>   ad.sOwningUser
         AND UserAuthority.FunctionCode = ad.sFunctionCode
        AND ( (UserAuthority.LowerBound <=  ad.nTaskValue
        AND UserAuthority.UpperBound >=  ad.nTaskValue)
        OR ad.sFunctionCode = 'RTS')
        AND  RowNum <= 100
        ORDER BY dteRun

When I omit “Order By dteRun” query runs in milliseconds however with Order By Clause it take more than minute. Whats problem with Order By Clause ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T02:26:16+00:00Added an answer on May 28, 2026 at 2:26 am

    There’s presumably no index on the dteRun column. If you want to do fast ORDER BY on a column, it needs an index.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

SELECT MIN(Measurement), (CASE 'NonDesMin' WHEN len(measurement) = 6 then '0000' ELSE '000' END) as
select case when cntrctr_lcns_seq_no is null then 1 else max(cntrctr_lcns_seq_no) end as cntrctr_lcns_seq_no from
SELECT DATE(DTM) AS'Dia', ROUND(COUNT(TMP)/4) AS 'Oídio' CASE ROUND(COUNT(TMP)/4)>=6 THEN '20' ROUND(COUNT(TMP)/4)<6 THEN '-10' END
SELECT COUNT(id), AgeRange FROM ( select id, case when age < 0 then 'less
SELECT COALESCE (rsu.last_name + ', ' + rsu.first_name + ' ' + rsu.middle_name +
select case when exists( select top 1 1 from dg_world_records wr (nolock) where wr.gametypeid
SELECT GETDATE() Returns: 2008-09-22 15:24:13.790 I want that date part without the time part:
select distinct constraint_type from user_constraints; C - C P R U Seems P means
select max(DELIVERY_TIMESTAMP) from DOCUMENTS; will return the time that the latest document was delivered.
SELECT `name` , COUNT(*) AS `count` FROM `t1`, `t2` WHERE `t2`.`id` = `t1`.`id` GROUP

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.