Print Page | Close Window

SQL Server - How to use Select clause

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: General Discussion
Forum Description: General discussion and chat on any topic.
URL: https://forums.webwiz.net/forum_posts.asp?TID=12210
Printed Date: 01 April 2026 at 1:38pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: SQL Server - How to use Select clause
Posted By: dudus
Subject: SQL Server - How to use Select clause
Date Posted: 17 October 2004 at 3:47am

How can I retrive in sql server several columns into variables

to retrieve one column for ex I use:

select @workerID = (select workerID from workers)

what can I do if i want the workerID and the WorkerName?




Replies:
Posted By: ljamal
Date Posted: 17 October 2004 at 9:41am
to retrieve one column you'd use:
select column1 from table

to retrieve two columns you'd use:
select column1, column2 from table

to select all the columns you'd use:
select * from table




-------------
L. Jamal Walton

http://www.ljamal.com/" rel="nofollow - L. Jamal Inc : Web/ Print Design and ASP Programming


Posted By: Mart
Date Posted: 17 October 2004 at 11:39am
I voted 2 because it is a bigger number than 1


Posted By: dpyers
Date Posted: 17 October 2004 at 12:34pm
I voted for 1 because it's a premier prime.

-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: Semikolon
Date Posted: 17 October 2004 at 3:14pm
I didn't vote because it wasn't meant to be a poll
but If I was supposed to vote I would have voted 1, cuz I am #1


but to answer the question:

do as ljamal showed you, and assign values to your variables using ASP or whatever programming language you use



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net