BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SQL: How to find duplicated values

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (ADO)
View previous topic :: View next topic  
Author Message
Vladimir Stefanovic
Guest





PostPosted: Tue Feb 22, 2005 5:56 pm    Post subject: SQL: How to find duplicated values Reply with quote



I have a table (MS ACCESS) with 2 fields:

1 field: MyText (TEXT)
2 field: MyBool (BOOL)

....which both should make a primary key, but first I
have somehow to get rid of duplicates:

I need an SQL which can find duplicates for me by
any of those tools: SQL Explorer, MS Access Query or
BCB6&ADOQuery.

Also why this do not work with any of the tools mentioned:

// This is only for a single field, not for both
select MyText, count(MyText) as Counter
from SomeTable
group by MyText
where Counter>1



--
Best regards,
Vladimir Stefanovic


Back to top
Viatcheslav V. Vassiliev
Guest





PostPosted: Tue Feb 22, 2005 9:07 pm    Post subject: Re: How to find duplicated values Reply with quote



This should work, at least from ADO - Jet supports subqueries:

select * from
(select MyText, count(MyText) as c
from SomeTable
group by lang1_MyText)
where c > 1

Note also that Counter is reserved work and should be enclosed in brackets -
[Counter].

//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)


"Vladimir Stefanovic" <antivari (AT) po (DOT) sbb.co.yu> сообщил/сообщила в новостях
следующее: news:421b7242$2 (AT) newsgroups (DOT) borland.com...
Quote:
I have a table (MS ACCESS) with 2 fields:

1 field: MyText (TEXT)
2 field: MyBool (BOOL)

...which both should make a primary key, but first I
have somehow to get rid of duplicates:

I need an SQL which can find duplicates for me by
any of those tools: SQL Explorer, MS Access Query or
BCB6&ADOQuery.

Also why this do not work with any of the tools mentioned:

// This is only for a single field, not for both
select MyText, count(MyText) as Counter
from SomeTable
group by MyText
where Counter>1



--
Best regards,
Vladimir Stefanovic




Back to top
Vladimir Stefanovic
Guest





PostPosted: Wed Feb 23, 2005 2:44 pm    Post subject: Re: How to find duplicated values Reply with quote



Thank you very much.

--
Best regards,
Vladimir Stefanovic
"Viatcheslav V. Vassiliev" <support (AT) oledbdirect (DOT) com> wrote

Quote:
This should work, at least from ADO - Jet supports subqueries:

select * from
(select MyText, count(MyText) as c
from SomeTable
group by lang1_MyText)
where c > 1

Note also that Counter is reserved work and should be enclosed in
brackets - [Counter].

//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)


"Vladimir Stefanovic" <antivari (AT) po (DOT) sbb.co.yu> сообщил/сообщила в новостях
следующее: news:421b7242$2 (AT) newsgroups (DOT) borland.com...
I have a table (MS ACCESS) with 2 fields:

1 field: MyText (TEXT)
2 field: MyBool (BOOL)

...which both should make a primary key, but first I
have somehow to get rid of duplicates:

I need an SQL which can find duplicates for me by
any of those tools: SQL Explorer, MS Access Query or
BCB6&ADOQuery.

Also why this do not work with any of the tools mentioned:

// This is only for a single field, not for both
select MyText, count(MyText) as Counter
from SomeTable
group by MyText
where Counter>1



--
Best regards,
Vladimir Stefanovic






Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (ADO) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.