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 6597305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:11:33+00:00 2026-05-25T18:11:33+00:00

[Using SQL Server 2000] I can’t believe a simple task is being this complex

  • 0

[Using SQL Server 2000]

I can’t believe a simple task is being this complex to write in SQL.

Perhaps I’m missing something.

Here’s the query that will not run because the column names are ambiguous:

SELECT serial_Number, system_id, date_time
FROM acp_parts ap 
INNER JOIN join test_results tr ON (ap.serial_Number=tr.serial_Number)
WHERE serial_Number IN (
    'C037687 1000 11', 'C037687 1001 11', 'C037687 1002 11', 'C037687 1003 11', 
    'C037687 1004 11', 'C037687 1005 11', 'C037687 1006 11', 'C037687 1007 11',
    'C037687 1008 11', 'C037687 1009 11', 'C037687 1010 11', 'C037687 1011 11', 
    'C037687 1012 11', 'C037687 1013 11', 'C037687 1014 11', 'C037687 1015 11',
    'C037687 1016 11', 'C037687 1017 11', 'C037687 1018 11', 'C037687 1019 11',
    'C037687 1020 11', 'C037687 1021 11', 'C037687 1022 11', 'C037687 1023 11', 
    'C037687 1024 11')
ORDER BY serial_Number, date_time

I’d just like a simple table with these serial numbers in one column, what table they are in (system_id), and when they were logged (date_time).

I do NOT want a separate column for each table – that would defeat the purpose of my query.

This is probably something simple that I’m missing.

[EDIT]: Sorry! I should have added that serial numbers in one table may or may not be in one of the other tables, so I do not want to display ap.serial_Number, etc.

[Solution]: Here’s what I went with that solved my problem:

SELECT serial_Number, system_id, date_time FROM ( 
    select serial_Number, system_id, date_time 
    from acp_parts ap 
    UNION ALL
    select serial_Number, system_id, date_time 
    from test_results tr
) T
where serial_Number in (
    'C037687 1000 11', 'C037687 1001 11', 'C037687 1002 11', 'C037687 1003 11', 'C037687 1004 11', 'C037687 1005 11', 
    'C037687 1006 11', 'C037687 1007 11', 'C037687 1008 11', 'C037687 1009 11', 'C037687 1010 11', 'C037687 1011 11', 
    'C037687 1012 11', 'C037687 1013 11', 'C037687 1014 11', 'C037687 1015 11', 'C037687 1016 11', 'C037687 1017 11', 
    'C037687 1018 11', 'C037687 1019 11', 'C037687 1020 11', 'C037687 1021 11', 'C037687 1022 11', 'C037687 1023 11', 
    'C037687 1024 11')
order by serial_Number, date_time
  • 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-25T18:11:33+00:00Added an answer on May 25, 2026 at 6:11 pm

    So, the number will only exist in one table or the other? I think you want a UNION ALL. The following is not syntax checked, but should get you started:

    SELECT * FROM 
    (
    select 
        serial_Number, 
        system_id, 
        date_time 
    from 
        acp_parts ap 
    
    UNION ALL
    
    select 
        serial_Number, 
        system_id, 
        date_time 
    from 
        acp_parts  test_results tr
    )
    ORDER BY serial_Number, date_time  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone find my error in this query? I'm using SQL Server 2000 and
I am using SQL Server 2000 and having a wierd issue with a SQL
I'm using SQL Server 2000 Enterprise Manager. I'm having trouble with storing some data
I'm using ASP.net membership system with SQL Server 2000 database. What I want to
I have an application which connects to SQL Server 2000 (using a generic SQL
On my prod server, I have 2 instances of SQL server, SQL Server 2000
Can any one Help me Please I want to Calculate 2 or more row
I'm running a query which returns decimals, then inserting those decimals into a table
Here are my tables: ----------------------------------------- Hotels ----------------------------------------- HotelID | HotelName ----------------------------------------- ----------------------------------------- HotelImages -----------------------------------------
Here are my tables: ----------------------------------------- Hotels ----------------------------------------- HotelID | HotelName ----------------------------------------- ----------------------------------------- HotelImages -----------------------------------------

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.