Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Easy Select Query

Status
Not open for further replies.

theif68

Technical User
Apr 3, 2005
39
US
How can I select a group of records from a table that includes the ";" in a specific column.

Example:
Column1 Column2
David 978-555-5555
Tom;Harry 617-555-5555

I would only want to select the second record. Also is it easy to change this to select the one that doesnt as well?
 
Code:
Select * from table where column1 like "*;*"

Code:
Select * from table where column1 unlike "*;*"

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Yeah, ok, so i was in a hurry [blush]

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Thanks alot guys!
I was missing the *'s in my query.
 
Sorry to keep this going is there a way to select 1 record from each dupe within the same query?

Example:
Column1 Column2
David 978-555-5555
Tom;Harry 617-555-5555
David 978-555-5555

I would only want david to show up once.
 
note that with SELECT DISTINCT you will not be able to edit the records from your query.
 
Select distint is for the entire row? not column?

SELECT DISTINCT [COMBINE EMAIL ADDRESS EXPORTS].NAME, [COMBINE EMAIL ADDRESS EXPORTS].ADDRESS
FROM [COMBINE EMAIL ADDRESS EXPORTS]
WHERE ((([COMBINE EMAIL ADDRESS EXPORTS].NAME) Not Like "*;*") AND (([COMBINE EMAIL ADDRESS EXPORTS].ADDRESS) Not Like "*;*"))
ORDER BY [COMBINE EMAIL ADDRESS EXPORTS].ADDRESS;


Is there a way to select distinct based on the address and not the name?

 
First of all you dont need to specify the form if it is both from the same form so you would have
Select Name, Adress
FROM [Combien email adress exports]
etc......

Secondly... why do you want to do this, could you inform of the purpose of your fonction....

order by will also stop you from modifying records from your query....
 
This is a merged list of Names / Email Address.

I need to create a final file that is going to give me only unique address's, by email address only not Name.

As you can notice they came out of outlook so there are records that were sent to multiple address hence the ";" between email address. I want to take care of these separatly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top