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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:40:59+00:00 2026-06-08T20:40:59+00:00

What i wannt is something like this: SELECT * FROM [dbo].[UNIONTABLE1] UNION SELECT *

  • 0

What i wannt is something like this:

SELECT * FROM [dbo].[UNIONTABLE1]
UNION 
SELECT * FROM [dbo].[UNIONTABLE2]
AS RESULTUNION;

DELETE FROM [dbo].[ResultTestTable];

INSERT INTO [dbo].[ResultTestTable]
  ( 
  test2
  ,test3
  ,test4
  ,test5
  ,test6
  ,test7
   )
  VALUES
  (
   RESULTUNION.LT_ALL_TAB_NAME
  ,RESULTUNION.LT_SCH_KL_RED_GASDRUCK
  ,RESULTUNION.LT_EINST_NOR_ZEIT + RESULTUNION.LT_EINST_NOR_AUSBLASZEIT
  ,RESULTUNION.LT_EINST_SAN_ZEIT + RESULTUNION.LT_EINST_SAN_AUSBLASZEIT
  ,RESULTUNION.LT_EINST_NOR_ZEIT_PCS + RESULTUNION.LT_EINST_NOR_AUSBLASZEIT_PCS
  ,RESULTUNION.LT_EINST_SAN_ZEIT_PCS + RESULTUNION.LT_EINST_SAN_AUSBLASZEIT_PCS
  );

I wannt to fill the ResultTestTable with all rows of the RESULTUNION table but only with specific columns of the RESULTUNION table.
And additionally i wannt to add two column datas of the RESULTUNION table and map it to one column in the ResultTestTable.
The added values are floats.

I m working with Microsoft SQL Server Management Studio.

The statemant above does not work, which is obvious, but i dont know how to do it right.
If I execute the statement above, i get the following error:
Msg 4104, Level 16, State 1, Procedure test_storedProcedure, Line 31
The multi-part identifier “RESULTUNION.LT_ALL_TAB_NAME” could not be bound.

I assume i have to do something like a for-loop but than i dont know how much rows the RESULTUNION table has to loop over.

Does anybody has an idea.
Thanx

  • 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-08T20:41:00+00:00Added an answer on June 8, 2026 at 8:41 pm

    First of all, never use “SELECT *” in your SQL, always specify the column names. Once you take that into account, it becomes easier to see the solution. Here it is:

    INSERT INTO [dbo].[ResultTestTable]
      (
      test2
      ,test3
      ,test4
      ,test5
      ,test6
      ,test7
       )
    SELECT 
      LT_ALL_TAB_NAME
      ,LT_SCH_KL_RED_GASDRUCK
      ,LT_EINST_NOR_ZEIT + LT_EINST_NOR_AUSBLASZEIT
      ,LT_EINST_SAN_ZEIT + LT_EINST_SAN_AUSBLASZEIT
      ,LT_EINST_NOR_ZEIT_PCS + LT_EINST_NOR_AUSBLASZEIT_PCS
      ,LT_EINST_SAN_ZEIT_PCS + LT_EINST_SAN_AUSBLASZEIT_PCS
    FROM [dbo].[UNIONTABLE1]
    UNION ALL -- This will keep duplicate rows. UNION, without ALL, removes duplicates
    SELECT 
      LT_ALL_TAB_NAME
      ,LT_SCH_KL_RED_GASDRUCK
      ,LT_EINST_NOR_ZEIT + LT_EINST_NOR_AUSBLASZEIT
      ,LT_EINST_SAN_ZEIT + LT_EINST_SAN_AUSBLASZEIT
      ,LT_EINST_NOR_ZEIT_PCS + LT_EINST_NOR_AUSBLASZEIT_PCS
      ,LT_EINST_SAN_ZEIT_PCS + LT_EINST_SAN_AUSBLASZEIT_PCS
    ROM [dbo].[UNIONTABLE2]
    

    Obviously, if the columns of the two tables have different names, you’ll have to amend the query accordingly.

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

Sidebar

Related Questions

i want something like this: SELECT DISTINCT ID from copies WHERE timestamp < 1229444506
In plain old SQL, I can do something like this: select * from mytable
I want to do something like this: select * from table order by id
I want to do something like this: select count(*) from (select ...) (As it
At http://dbpedia.org/sparql/ I want to select something like this: SELECT ?hostCity WHERE { <http://dbpedia.org/resource/Lisbon>
I want to do something like this in SQL Server: SELECT pt.quantity AS 'QTY'
I want something like this: abcdab.search(/a/g) //return [0,4] Is it possible?
Hey i wanna do something like this: i=2; _root.(process + i)._x = var_Process_Pos_x; how
I want to parse something like this: Hi [{tagname:content}] [{tag1:xnkudfdhkfujhkdjki diidfo now nested tag
I want to do something like this: require 'erb' @var = 'test' template =

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.