?
Solved

Help needed with SQL Select Query

Posted on 2007-10-11
3
Medium Priority
?
167 Views
Last Modified: 2010-03-20
Hi all,

I need help with an SQL Query.

I'm got a column called AcountID and I need to Select ALL the Fields under AccountID Column but NOT Repeated. In other words, just one of each.

Hope you can help.

Thanks

-ST3VO
0
Comment
Question by:ST3VO
3 Comments
 
LVL 16

Accepted Solution

by:
SQL_SERVER_DBA earned 2000 total points
ID: 20058866
select distinct accountid from <tablename>
0
 
LVL 9

Expert Comment

by:brunoguimaraes
ID: 20058951
Or:

select accountid from <tablename> group by accountid
0
 

Author Comment

by:ST3VO
ID: 20059099
Thanks both. I know both answers are right but I only used one of them.

Cheers!!!
0

Featured Post

Independent Software Vendors: 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

PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
Recursive SQL is one of the most fascinating and powerful and yet dangerous feature offered in many modern databases today using a Common Table Expression (CTE) first introduced in the ANSI SQL 99 standard. The first implementations of CTE began ap…
Loops Section Overview
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

839 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