Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
I didn't quite get that. I slapped an extra ; after the UNION keyword but I got an error "Selects are not Union compatible". But at any rate, the client will be inputting the cPolicySymbol and cPolicyNumber every time, so I have to fit that into the WHERE clause as well (can't use HAVING since I don't get index optimization). I am playing with your idea to use UNION but haven't had any luck so far.....
Thanks.
>Not sure if the empty date format will work properly for you.
>
>A couple of issues.
>
>1. The SELECT in itself cannot guarantee that only one record will be returned for each of the unioned selects. That's a data driven issue, and you may have problems if multiple records have the same effective or expiration date.
>
>2. The goal is essentially a cross tab result set. Within the constraints of a one line SQL statement, I don't know how do that. The above query returns two rows, assuming that there is only one record for each of the min and max values. Will that work for you?
>
> Jay
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement