use having nistead of where in case of virtual columns