How to Delete/Remove Duplicate Records/Rows from Snowflake Table? Snowflake| VCKLY Tech| Data Cloud

Поділитися
Вставка
  • Опубліковано 29 сер 2024

КОМЕНТАРІ • 38

  • @ExploreWithJay14
    @ExploreWithJay14 4 місяці тому +1

    only the swap table with intermediate tables and usng distinct and creating will works

  • @RaviTheVlogger
    @RaviTheVlogger 2 роки тому +1

    very good one. most commonly asked scenario.

  • @Sathvik_Gajjela
    @Sathvik_Gajjela 2 роки тому +3

    Hi Sir, Very well explained. Thank you..

  • @msk-pl3hw
    @msk-pl3hw 2 роки тому +1

    Thank you. It was helpful

  • @tarun6444
    @tarun6444 2 роки тому +2

    Thank you so much Video is very useful, please provide your exercise text copy on description

    • @VCKLYTech
      @VCKLYTech  2 роки тому +1

      Thanks. copied in description

    • @tarun6444
      @tarun6444 2 роки тому

      @@VCKLYTech thank you so much sir

  • @kjvinayagam2542
    @kjvinayagam2542 2 роки тому +1

    Gm Sir,
    This is selvavinayagam.
    I am followers.
    I have an question.
    Q: kindly advice on difference bt warehouse vs worksheets?
    Thanks.

    • @VCKLYTech
      @VCKLYTech  2 роки тому

      Virtual Warehouse is a compute engine to execute/run select, insert, update, delete, merge and copy command etc..
      Worksheet is place where you want to keep all your commands

    • @kjvinayagam2542
      @kjvinayagam2542 2 роки тому

      @@VCKLYTech sir
      I am seeing all sql execution at worksheet.
      Is there mani difference?
      Thanks sir

  • @gsreenivasulu3246
    @gsreenivasulu3246 2 роки тому +1

    Nice explain

  • @meshtyyy
    @meshtyyy Рік тому +1

    what if you have million records? Is it practical to insert all the records

    • @abinpaul00
      @abinpaul00 Рік тому

      1.Pick duplicate records to an intermediate table.
      2.Delete the same from the main table.
      3.Insert unique rows form intermediate table to main table.
      This approach in most cases will make sure that less number of micro partitions are affected.

  • @gsreenivasulu3246
    @gsreenivasulu3246 2 роки тому +1

    Please make vidio on one project

  • @rameshram1117
    @rameshram1117 Рік тому

    Cannot delete duplicate without adding extra column insert_ts in case 3 and 4 methods

  • @chandangupta1989
    @chandangupta1989 2 роки тому +1

    If we are dropping table and renaming then will grant given to some role revoked ?

    • @VCKLYTech
      @VCKLYTech  2 роки тому +1

      Yes you are correct. This case can can go with Alter table SWAP WITH

    • @chandangupta1989
      @chandangupta1989 2 роки тому

      @@VCKLYTech One more thing, optional suggestion that to make it video short data population in table should be in advance so that only actual concept we can focus.

    • @VCKLYTech
      @VCKLYTech  2 роки тому

      @@chandangupta1989 Sure . I will consider your suggestion. thank you

  • @aakankshagupta7899
    @aakankshagupta7899 2 роки тому

    Here you inserted 4 columns, so you were able to insert timestamps two times, once with current date and then with current date -1.. but what if we have millions of records in the table & we have duplicates

  • @Sathvik_Gajjela
    @Sathvik_Gajjela 2 роки тому

    Sir,In interview if they ask what have you done as a snowflake developer in your previous project what all we can say in shot ..

  • @praveendeshmukh1952
    @praveendeshmukh1952 2 роки тому +1

    Can we use with clause query in snowflakes ?

    • @VCKLYTech
      @VCKLYTech  2 роки тому

      Yes . We can use WITH Clause in snowflake

    • @praveendeshmukh1952
      @praveendeshmukh1952 2 роки тому

      @@VCKLYTech Ok the can we delete these duplicate records using below query.
      With q1 as (select a.*, Row_number() over(partition by deptno order by deptno) rno from dept)
      Delete from q1 where rno > 1;
      Or
      Delete from (select a.*, Row_number() over(partition by deptno order by deptno) rno from dept) where rno>1;

    • @VCKLYTech
      @VCKLYTech  2 роки тому

      @@praveendeshmukh1952 No, will not work because there is no such column rno from the dept table.

    • @praveendeshmukh1952
      @praveendeshmukh1952 2 роки тому

      @@VCKLYTech Thank you for your reply 👍

  • @rameshram1117
    @rameshram1117 Рік тому

    Sir tell me how to do without adding extra column in case 3 and 4

  • @rajinikanthgudimalla5454
    @rajinikanthgudimalla5454 2 роки тому

    Can you make a project explanation....

  • @rajakumar1254
    @rajakumar1254 2 роки тому

    Hi