i'm siva from paris..i'm an electronics engineering student..currently, i'm doing a practical on databases creation in a DVD shop in paris(about which i don't know any single thing)..
i have a table called codes which has the following 8 column:
ind (serial)
code_principal(varchar)
code_secondaire1(varchar) default NULL
code_secondaire2(varchar) default NULL
code_secondaire3(varchar) default NULL
code_secondaire4(varchar) default NULL
code_secondaire5(varchar) default NULL
code_secondaire6(varchar) default NULL
Actually, this table is used to stock in the secondary codes of a product bcoz a product can have more than one barrecode or id....code_principal is a barrecode of the product chosen at first;
i want to create a function with PL/pgsql to clean my table codes bcoz in this table there are alot of reduncancy for exemple in one ligne there's code_secondaire1 = code_secondaire2 and so on. In this example, the function that i wanna create must delete the code_secondaire 2 or more precisely set it as NULL..
can anyone pls help me to do this...thanx alot in advance!
siva.