Upgrade to Pro — share decks privately, control downloads, hide ads and more …

What Not To Do With Databases

Tim Perry
November 11, 2014

What Not To Do With Databases

Tim Perry

November 11, 2014
Tweet

More Decks by Tim Perry

Other Decks in Programming

Transcript

  1. SELECT m.name FROM Employee e INNER JOIN Employee m ON

    e.manager_id = m.id WHERE e.id = 100;
  2. WITH RecursiveCte AS ( SELECT e.id, e.name FROM Employee e

    WHERE parent_id = 100 UNION ALL SELECT e.id, e.name FROM Employee e INNER JOIN RecursiveCte rcte ON e.parent_id = rcte.id ) SELECT Name FROM RecursiveCte;