This shows you the differences between two versions of the page.
kurs:simpsons [2014/09/10 21:22] |
kurs:simpsons [2014/09/10 21:22] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <code> | ||
+ | /* Formatted on 2008/09/30 21:07 (Formatter Plus v4.8.7) */ | ||
+ | SELECT isa.per_name || ' ist ein ' || relation_type.ret_name ||' von '|| persons.per_name | ||
+ | FROM persons, relations, persons isa, relation_type | ||
+ | WHERE ( (persons.per_id = relations.rel_parent) | ||
+ | AND (isa.per_id = relations.rel_child) | ||
+ | AND (relation_type.ret_id = relations.rel_ret_id) | ||
+ | ) | ||
+ | </code> | ||
+ | insert | ||
+ | |||
+ | <code> | ||
+ | insert into relations ( | ||
+ | REL_ID, | ||
+ | REL_PARENT, | ||
+ | REL_CHILD, | ||
+ | REL_RET_ID) | ||
+ | values ( | ||
+ | sim.nextval, | ||
+ | (select per_id from persons where per_name = 'Bart'), | ||
+ | (select per_id from persons where per_name = 'Homer'), | ||
+ | (select ret_id from relation_type where ret_name = 'Elternteil')); | ||
+ | </code> |