[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Select Statment

Posted on 2007-07-21
1
Medium Priority
?
180 Views
Last Modified: 2010-03-19
I have a table contain about 100 row each row contains these fields:
ID
CustomerName
DepartmentName

As you saw its a flat table,
I want to get from this table a select statment that will give me all the Departments "no duplicate" from that table.

DataSamle:
ID             CustmerName           DepartmentName
=======================================
1               cust1                        depart1
2               cust2                        depart1
3               cust3                        depart2
3               cust3                        depart2
3               cust3                        depart3


if i run my select that i want from you s i must see:
dept1
dept2
dept3
0
Comment
Question by:amrelgarhy81
1 Comment
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 200 total points
ID: 19537991
select distinct departmentName from yourTable
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
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…

825 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