 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Vladimir Stefanovic Guest
|
Posted: Tue Feb 22, 2005 5:56 pm Post subject: SQL: How to find duplicated values |
|
|
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
|
Posted: Tue Feb 22, 2005 9:07 pm Post subject: Re: How to find duplicated values |
|
|
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
|
Posted: Wed Feb 23, 2005 2:44 pm Post subject: Re: How to find duplicated values |
|
|
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 |
|
 |
|
|
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
|
|