We help IT Professionals succeed at work.

can i create a command insert or replace WHERE ( based on data in non unique id colum)

I wanna eliminate duplicates , for a number of reasons if can't use my unique Identifier... is there a command that I can use ....I am currently using insert or replace and I know that this command is dependent on the unique Id... but my next column generates a random number that is assigned to every entry... can i create a command insert or replace WHERE ( based on random column data) ... can I do this and how .... Im using sqlite3 and python 2.6
Comment
Watch Question

CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
You can do that, but it could update multiple rows.

you can use like ='%pattern%'

Author

Commented:
Thanks Im new what is like pattern

Commented:
Too confuse for me.

INSERT/REPLACE data WHERE ???

I did understand.

If you need to get data with no duplicates you can use something like

SELECT sub.columns, YOUR_RANDOM_NUMBER
FROM (SELECT DISTINCT column FROM table WHERE conditions) sub

CERTIFIED EXPERT
Distinguished Expert 2019
Commented:
The pattern is what you want to look for in the column.

Author

Commented:
Thanks

Explore More ContentExplore courses, solutions, and other research materials related to this topic.