Igor Tandetnik wrote:
>
> flakpit <[EMAIL PROTECTED]> wrote:
>> Is there a way of querying the database to list all duplicate entries
>> from a column in the same table?
>>
>> Something like "SELECT * FROM mytable WHERE last NOT UNIQUE"
>
> select * from mytable t1 where exists (
> select *
: [sqlite] Listing duplicate entries
Is there a way of querying the database to list all duplicate entries from a
column in the same table?
Something like "SELECT * FROM mytable WHERE last NOT UNIQUE"
fred, johnson
roger, johnson
--
View this message in context:
http://www
Hello Igor,
sorry, i was too fast. The following does it:
create table mytable (a string, b string);
insert into mytable (a,b) values ('Joe', 'Smith');
insert into mytable (a,b) values ('Ann', 'Smith');
insert into mytable (a,b) values ('Fred', 'Miller');
select * from mytable where b in
(
sel
flakpit wrote:
> Is there a way of querying the database to list all duplicate entries from a
> column in the same table?
>
> Something like "SELECT * FROM mytable WHERE last NOT UNIQUE"
>
> fred, johnson
> roger, johnson
>
>
An unoptimised 'off the top of my head' solution would be:
select * f
Martin Engelschalk
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> let the table have two columns, "a" and "b". Then
>
> select a, count(b)
> from yourtable
> group by a
> having count(b) > 1
>
> returns 'fred' and 'roger'.
No it doesn't. It returns an empty set. Try it.
Igor Tandetnik
_
flakpit <[EMAIL PROTECTED]> wrote:
> Is there a way of querying the database to list all duplicate entries
> from a column in the same table?
>
> Something like "SELECT * FROM mytable WHERE last NOT UNIQUE"
select * from mytable t1 where exists (
select * from mytable t2 where t1.last=t2.last
Hi,
let the table have two columns, "a" and "b". Then
select a, count(b)
from yourtable
group by a
having count(b) > 1
returns 'fred' and 'roger'.
Martin
flakpit wrote:
> Is there a way of querying the database to list all duplicate entries from a
> column in the same table?
>
> Something like
Is there a way of querying the database to list all duplicate entries from a
column in the same table?
Something like "SELECT * FROM mytable WHERE last NOT UNIQUE"
fred, johnson
roger, johnson
--
View this message in context:
http://www.nabble.com/Listing-duplicate-entries-tp16941525p1694152
8 matches
Mail list logo