Monthly Archives: February 2009

Selecting a random employee with adjacency tables

In my previous blogpost I mentioned a way to retrieve the entire tree from a hierarchy stored with adjacency tables. Now I’ve got a way to retrieve a random employee in an organisation. I use ORDER BY NEWID() to randomize … Continue reading

Posted in sql | 1 Comment

Adjacency tables

I’m well aware that adjacency tables aren’t the newest way of storing hierarchies in a database. Personally I prefer to use nested sets. But on this one project I had to work with a legacy database. It took me quite … Continue reading

Posted in sql | Comments Off on Adjacency tables