Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
IIF(,,) in an SQL Server SQL Statement
Message
De
19/04/2000 11:02:20
 
 
À
18/04/2000 19:40:20
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00360347
Message ID:
00361280
Vues:
16
Snip...
>What value should SQL Server return for city? Within this table there will probably be more than one city for each state. VFP picks a value. I don't know of there's any reasoning to the value that's chosen nor would I want to rely on it. SQL Server (and the ANSI standard I believe) take the easy approach and just don't allow it.
>
>BTW, this query should return all the info that you thought the above query would (I hope, it's completely off the cuff <s>)
>
>
SELECT city, state, population
>FROM countrydata
>WHERE population = (
> SELECT MAX(population)
> FROM countrydata cd
> WHERE state = countrydata.state)


I would have to agree, VFP should do the same thing.

As for your correlated sub query, what is the "cd" in the from clause for, or is it one of those off the cuff things :) I will have to play around with sub queries, they could be pretty potent.
Thanks
Jon
Non-MVP Non-MCP Non-MCSE

Visual FoxPro, What else is there?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform