small SQL bug question