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

x
?
Solved

SQL query Axcess

Posted on 2009-04-15
3
Medium Priority
?
341 Views
Last Modified: 2012-05-06
Dear Experts,
I'm using Axcess and I need to write and SQL script that should bring me
unique names and everything on the same line.

I have table which has collomns Name, Phone, Email

when I write SELECT  distinct TableName.Name
FROM TableName;
the result shows only the NAME, but I want to select disctinct only name but I want to see the related information that the name refers to.

For example if the the Name  Mr. Ancek Anderson is unique I want to see all the information about Mr. Ancek Anderson.

how should I write the sql script?

thank you in advance.
0
Comment
Question by:Braveheartli
  • 2
3 Comments
 
LVL 29

Accepted Solution

by:
David H.H.Lee earned 2000 total points
ID: 24145658
Hi Braveheartli,
Try this:
SELECT  TableName.Name, TableName.Phone, TableName.Email
FROM TableName where exists(SELECT distinct TA.Name FROM TableName AS TA where TA.Name= TableName.Name) 

Open in new window

0
 
LVL 1

Author Comment

by:Braveheartli
ID: 24145714
thank you x_com
What does TA mean?
0
 
LVL 29

Expert Comment

by:David H.H.Lee
ID: 24145781
Hi Braveheartli,
TA mean alias or it is shorthand notation. You can declare it under different alias for each referred table and reuse it over your query easily. Beside that table alias also used to remove the ambiguity of the column names used in different tables especially if using in complex query.


0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this article, I’ll look at how you can use a backup to start a secondary instance for MongoDB.
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

830 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