Jump to content

sql experts please come very urgent


Recommended Posts

Posted

Table: 

 

DEV                                      Qa                                 PROD

S1,S1,S1,S2                       S3,S3,S3                          S4

 

Result: 

 

Dev                               QA                                    PROD

S1,S2                             S3                                      S4

 

Posted
1 hour ago, gupta24 said:

Table: 

 

DEV                                      Qa                                 PROD

S1,S1,S1,S2                       S3,S3,S3                          S4

 

Result: 

 

Dev                               QA                                    PROD

S1,S2                             S3                                      S4

 

*=:

Posted
1 hour ago, gupta24 said:

Table: 

 

DEV                                      Qa                                 PROD

S1,S1,S1,S2                       S3,S3,S3                          S4

 

Result: 

 

Dev                               QA                                    PROD

S1,S2                             S3                                      S4

 

group by ani option untadhi chudu.. group by Dev, QA add cheyi last lo

Posted

Regular expression use cheyyali... direct remove duplicates from column value ani google cheyyi

 

regexp_replace( 'VA - HRD 1, VA - HRD 1, VA - NOVA 1, VA - NOVA 1' ,'([^,]+)(,[ ]*\1)+', '\1')
Posted
1 hour ago, WigsandThighs said:

Delete from table kottu bhayya antha crystal clear ga untadhi%$#$ 

ch.thumb.gif.6d7eb62c38b6520a4bff3da3e56

Posted
3 hours ago, gupta24 said:

Table: 

 

DEV                                      Qa                                 PROD

S1,S1,S1,S2                       S3,S3,S3                          S4

 

Result: 

 

Dev                               QA                                    PROD

S1,S2                             S3                                      S4

 

If you have another seq field or audit fields.. its easy to remove.. See below as an example.. Here all rows will be deleted except the one whose insert_date is lowest.

 

 delete films f
  where  insert_date not in (
    select min(insert_date)
    from   films s
    where  f.title = s.title
    and    f.uk_release_date = s.uk_release_date
  ) 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...