Announcement

Collapse
No announcement yet.

Referenza auf eigene Tabelle

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Referenza auf eigene Tabelle

    Hallo,

    weiß jemand wie es funktioniert eine Referenz auf die eigene Tabelle zu erstellen?

    Also ein Link auf sich selbst?

    Danke

    Gruß Tobi

  • #2
    Genau so, wie Du auch eine Referenz auf eine andere Tabelle erstellst, nur dass Du dort eben den Namen der eigenen Tabelle angibst.

    Code:
    create table t id number primary key,
      col1 number references t);
    Diese sytax würde für Oracle funktionieren, andere Datenbanken können davon abweichen.

    Dim
    Zitat Tom Kyte:
    I have a simple philosophy when it comes to the Oracle Database: you can treat it as a black box and just stick data into it, or you can understand how it works and exploit it as a powerful computing environment.

    Comment


    • #3
      vielen Dank erstmal, wie referenziere ich einen datensatz in der tabelle

      ich habe eine tabelle und möchte im ersten datensatz den 3 datensatz referenzieren

      Comment


      • #4
        Indem Du bei dem betreffenden Datensatz im Feld des Foreign Key den PK des zu referenzierenden einträgst.

        Dim
        Zitat Tom Kyte:
        I have a simple philosophy when it comes to the Oracle Database: you can treat it as a black box and just stick data into it, or you can understand how it works and exploit it as a powerful computing environment.

        Comment

        Working...
        X