4

I have a table as follows:

CREATE TABLE xyz (
    id text,
    profile_name text,
    cret_dt timestamp,
    cret_id text,
PRIMARY KEY(id, profile));

It also has some data.

Now, when I run this query:

select id  from xyz ; 

It returns 165 rows

Again, when I run this query:

select distinct id  from xyz ;

It returns 162 rows.

Is there any way to find out the duplicate 3 rows?

Aaron
  • 55,518
  • 11
  • 116
  • 132
TheRedDevils
  • 41
  • 1
  • 4
  • @Gomes, I don't see how this should work. There is no such thing as a `GROUP BY` clause in CQL. Using count(*) in a query yields a single row with the number of rows in the result set. – Ralf Mar 11 '16 at 08:51
  • @ralf is right, basically get all the records in client and for a particular key if the second cluster column count is more than 1 then that is the duplicate row. Again if you want to avoid having duplicate key, your partiion key shoudld have that column like CREATE TABLE xyz ( id text, profile_name text, cret_dt timestamp, cret_id text, PRIMARY KEY((id, profile)) ); – Gomes Mar 11 '16 at 19:49

0 Answers0