phpbar.de logo

Mailinglisten-Archive

How to remove duplicates from a table and updating the second

How to remove duplicates from a table and updating the second

Matthias Wieschke mw at media-style.com
Mit Mai 26 18:22:31 CEST 2004


I have associations between values "AAA" and "BBB". They are stored in 2
tables.
Unfortunable table1.value is not unique and now I have duplicated entries.

## What I have is:

Table1: Values
ID     Value
----------------
1        AAA
2        BBB
3        AAA
4        CCC

Table2: Association
ID1     ID2
--------------
1         2
3         4

## What I want after query is:

Table1:
ID     Value
---------------
1         AAA
2         BBB
3         CCC

Table2
ID1     ID2
-------------
1         2
1         4

Can I do this with one query? Any help is appreciated.
-------------- nächster Teil --------------
Ein Dateianhang mit HTML-Daten wurde abgetrennt...
URL: http://lists.mushaake.org/pipermail/mysql-de/attachments/20040526/d83a31ba/attachment.html

php::bar PHP Wiki   -   Listenarchive