Better SQL for tags.