Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Format Dataset with SELECT

Posted on 2007-08-12
2
Medium Priority
?
175 Views
Last Modified: 2010-03-19
Hi

Please could someone assist me with formatting my output data into the following dataset:

I have calculated two sets of variables i.e.

SET @vara_1 = <value>
SET @vara_2 = <value>

SET @varB_1 = <value>
SET @varB_2 = <value>

I now want to SELECT these so that the datset appears as follows

VARAVALUES   VARBVALUES
vara_1                 varB_1
vara_2                 varB_2


Thanks

I have selected two datsets
0
Comment
Question by:IlanOssin
2 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 200 total points
ID: 19678897
SELECT @vara_1 VARAVALUES, @varb_1 VARBVALUES
UNION ALL
select @vara_2 VARAVALUES, @varb_2 VARBVALUES
0
 

Author Comment

by:IlanOssin
ID: 19679111
Thanks!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question