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

  • Home
  • SEARCH
  • 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 8549583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:44:55+00:00 2026-06-11T13:44:55+00:00

I have Query below, the query return correct result, but when there more then

  • 0

I have Query below, the query return correct result, but when there more then 10000 row in table cslogcurve_datanode, My Query take long time effort, and i want to ask how to optimize or the best sintax for my query and must return same result with my query below

 SELECT DISTINCT
    (SELECT dataNode FROM cslogcurve_datanode s1 WHERE logCurveInfoUID = 'W-12B-01f34a-lci-1' AND s1.baseNodeDouble = t.baseNodeDouble) AS R1,
    (SELECT dataNode FROM cslogcurve_datanode s1 WHERE logCurveInfoUID = 'W-12B-01f34a-lci-10' AND s1.baseNodeDouble = t.baseNodeDouble) AS R2
     (SELECT dataNode FROM cslogcurve_datanode s1 WHERE logCurveInfoUID = 'W-12B-01f34a-lci-11' AND s1.baseNodeDouble = t.baseNodeDouble) AS R3,
     (SELECT dataNode FROM cslogcurve_datanode s1 WHERE logCurveInfoUID = 'W-12B-01f34a-lci-12' AND s1.baseNodeDouble = t.baseNodeDouble) AS R4,
     (SELECT dataNode FROM cslogcurve_datanode s1 WHERE logCurveInfoUID = 'W-12B-01f34a-lci-13' AND s1.baseNodeDouble = t.baseNodeDouble) AS R5,
     (SELECT dataNode FROM cslogcurve_datanode s1 WHERE logCurveInfoUID = 'W-12B-01f34a-lci-14' AND s1.baseNodeDouble = t.baseNodeDouble) AS R6,
     (SELECT dataNode FROM cslogcurve_datanode s1 WHERE logCurveInfoUID = 'W-12B-01f34a-lci-15' AND s1.baseNodeDouble = t.baseNodeDouble) AS R7,
     (SELECT dataNode FROM cslogcurve_datanode s1 WHERE logCurveInfoUID = 'W-12B-01f34a-lci-16' AND s1.baseNodeDouble = t.baseNodeDouble) AS R8,
     (SELECT dataNode FROM cslogcurve_datanode s1 WHERE logCurveInfoUID = 'W-12B-01f34a-lci-17' AND s1.baseNodeDouble = t.baseNodeDouble) AS R9,
     (SELECT dataNode FROM cslogcurve_datanode s1 WHERE logCurveInfoUID = 'W-12B-01f34a-lci-18' AND s1.baseNodeDouble = t.baseNodeDouble) AS R10
     (SELECT dataNode FROM cslogcurve_datanode s1 WHERE logCurveInfoUID = 'W-12B-01f34a-lci-19' AND s1.baseNodeDouble = t.baseNodeDouble) AS R11,
     (SELECT dataNode FROM cslogcurve_datanode s1 WHERE logCurveInfoUID = 'W-12B-01f34a-lci-2' AND s1.baseNodeDouble = t.baseNodeDouble) AS R12,
     (SELECT dataNode FROM cslogcurve_datanode s1 WHERE logCurveInfoUID = 'W-12B-01f34a-lci-20' AND s1.baseNodeDouble = t.baseNodeDouble) AS R13,
     (SELECT dataNode FROM cslogcurve_datanode s1 WHERE logCurveInfoUID = 'W-12B-01f34a-lci-21' AND s1.baseNodeDouble = t.baseNodeDouble) AS R14,
     (SELECT dataNode FROM cslogcurve_datanode s1 WHERE logCurveInfoUID = 'W-12B-01f34a-lci-3' AND s1.baseNodeDouble = t.baseNodeDouble) AS R15,
     (SELECT dataNode FROM cslogcurve_datanode s1 WHERE logCurveInfoUID = 'W-12B-01f34a-lci-4' AND s1.baseNodeDouble = t.baseNodeDouble) AS R16,
     (SELECT dataNode FROM cslogcurve_datanode s1 WHERE logCurveInfoUID = 'W-12B-01f34a-lci-5' AND s1.baseNodeDouble = t.baseNodeDouble) AS R17,
     (SELECT dataNode FROM cslogcurve_datanode s1 WHERE logCurveInfoUID = 'W-12B-01f34a-lci-6' AND s1.baseNodeDouble = t.baseNodeDouble) AS R18,
     (SELECT dataNode FROM cslogcurve_datanode s1 WHERE logCurveInfoUID = 'W-12B-01f34a-lci-7' AND s1.baseNodeDouble = t.baseNodeDouble) AS R19,
     (SELECT dataNode FROM cslogcurve_datanode s1 WHERE logCurveInfoUID = 'W-12B-01f34a-lci-8' AND s1.baseNodeDouble = t.baseNodeDouble) AS R20,
     (SELECT dataNode FROM cslogcurve_datanode s1 WHERE logCurveInfoUID = 'W-12B-01f34a-lci-9' AND s1.baseNodeDouble = t.baseNodeDouble) AS R21 
  FROM cslogcurve_datanode t ORDER BY R1 ASC
  • 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-06-11T13:44:57+00:00Added an answer on June 11, 2026 at 1:44 pm

    Use IN clause instead.
    Syntax:

    SELECT DISTINCT <COLUMN> 
    FROM <TABLE> 
    WHERE <COLUMN> IN (<VALUE1>,<VALUE2>,...) 
    ORDER BY <COLUMN>;
    

    So your query should be like this:

    SELECT DISTINCT dataNode 
    FROM cslogcurve_datanode 
    WHERE logCurveInfoUID IN ('W-12B-01f34a-lci-1', 'W-12B-01f34a-lci-10'
                             ,'W-12B-01f34a-lci-11','W-12B-01f34a-lci-12'
                             ,'W-12B-01f34a-lci-13',....)
    ORDER BY dataNode ASC;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a query that returns a result set similar to the one below:
I have a relatively complex query that I'm running. I've included it below, but
I have the below query in access 2007 which gave me correct results using
The query below returns rows that have both loginid and ip2 in the bumps
I'm using Sql-Server, and I have the below query which returns all columns that
I have a problem with the SQL statement detailed below. The query returns the
I have a query below that I use to retrieve the records not updated
We have the query below. Using a LEFT OUTER join takes 9 seconds to
I have the query below that when run it says that 325 rows were
I have below query I am trying to show message 'No SubSource for this

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.