Scopo
Questa funzione verifica se la subquery restituisce almeno un valore.
Sintassi
exists(subquery)
Argomenti
Sub Query | Sub Query da verificare |
Valore di ritorno
Viene restituito True se la Sub Query restituisce almeno un valore.
Esempio
// Recupera i record da mostrare nel pannello
// Escludo le categorie che non hanno nessun prodotto
select
Idcategoria
NomeCategoria
Descrizione
from
Categorie // master table
where
exists(subquery)
select //
Idprodotto
from
Prodotti // master table
where
Prodotti.Idcategoria == Categorie.Idcategoria
// Escludo le categorie che non hanno nessun prodotto
select
Idcategoria
NomeCategoria
Descrizione
from
Categorie // master table
where
exists(subquery)
select //
Idprodotto
from
Prodotti // master table
where
Prodotti.Idcategoria == Categorie.Idcategoria
Ultima modifica: 07/05/2010 / Validità: da 9.1.4040
- E' consigliato utilizzare questa funzione nelle clausole where.