Remove some redundant SQL queries

Created by  Eelco Dolstra  on April 23, 2013
HWKCMAK5MMOKAZG7JJOTWCPB5EL2BABBGNDR22TS2JT3NOIWMIAQC
Change contents