1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| scratch=# \d matos
Table "public.matos"
Column | Type | Modifiers
--------+-----------------------+-----------
id | integer | not null
id_cur | integer |
nom | character varying(30) |
Indexes:
"matos_pkey" primary key, btree (id)
scratch=# select * from matos;
id | id_cur | nom
----+--------+------------
0 | | PC
1 | 0 | carte mère
2 | 0 | carte son
3 | 0 | écran
4 | 1 | processeur
(5 rows)
scratch=# select m1.nom,m2.nom from matos m1, matos m2 where m1.id = m2.id_cur
and m1.id = 0;
nom | nom
-----+------------
PC | carte mère
PC | carte son
PC | écran
(3 rows) |
Partager