infogulch

Untitled

Jun 11th, 2012
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.33 KB | None | 0 0
  1. INSERT INTO parent_of (id, parent_id, isdir, name)
  2. VALUES (1, NULL, 1, 'root')
  3.      , (2, 1, 0, 'file1')
  4.      , (3, 1, 1, 'dir1')
  5.      , (4, 1, 0, 'file2')
  6.      , (5, 1, 1, 'dir2')
  7.      , (6, 5, 0, 'file3')
  8.      , (8, 7, 0, 'file4'); -- last one is orphan
  9.  
  10. INSERT INTO parent_of VALUES (7, 5, 1, 'dir3'); -- orphan is resolved
Advertisement
Add Comment
Please, Sign In to add comment