Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Query without max()
Message
De
16/09/2019 13:57:39
 
 
À
16/09/2019 11:44:39
Walter Meester
HoogkarspelPays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01670845
Message ID:
01670899
Vues:
87
>Cetin
>
>You are refering to a recursive query, which I (I admit the mischaracterization as recursive CTEs can be use in creating records as well) referred to as for solving hierarchical problems. This is where I almost exclusively use them for.
>
>The challenge was to find me an example where using CTE as a subquery would lead to any significant advantage.

I've run into cases where I need the same subquery in multiple parts of a query. A CTE lets me write it once and use it repeatedly. Don't have an example handy, but it shouldn't be hard to think of one.

FWIW, I also find queries with CTEs (especially when there are several) far more readable than queries with lots of derived table. The case where I think readability is most aided is when otherwise, I'd have a long nested set of queries. In my view, those are so hard to read, and the CTE lays things out neatly so you can follow what's happening.

Tamar
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform