smartplaylists: cosmetics in SQL queries
smartplaylists: use SELECT DISTINCT in SQL sub-queries
smartplaylists: replace SQL IN with SQL EXISTS in WHERE conditions