Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - SQL Server - How to use Select clause
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

SQL Server - How to use Select clause

 Post Reply Post Reply
Poll Question: SQL Server - How to use Select clause
Poll Choice Votes Poll Statistics
1 [33.33%]
2 [66.67%]
You can not vote in this poll

Author
dudus View Drop Down
Newbie
Newbie


Joined: 17 October 2004
Location: Israel
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote dudus Quote  Post ReplyReply Direct Link To This Post Topic: SQL Server - How to use Select clause
    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?

Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post 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


Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 17 October 2004 at 11:39am
I voted 2 because it is a bigger number than 1
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Semikolon View Drop Down
Senior Member
Senior Member


Joined: 09 September 2003
Location: Norway
Status: Offline
Points: 1718
Post Options Post Options   Thanks (0) Thanks(0)   Quote Semikolon Quote  Post ReplyReply Direct Link To This Post 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


Edited by Semikolon
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.