You are here

Добавить комментарий

EXISTS - Records Exist

Syntax

Description:

    EXISTS is used with subquerys (sub-SELECTs) and have the value 'TRUE', when the subselect returns data. When no data is returned then this operator have the value 'FALSE'.

    Example:

SELECT DISTINCT knum
 FROM tkunden outer
 WHERE EXISTS
 ( SELECT * FROM tkunden inner
   WHERE inner.vnum=outer.vnum AND inner.knum&lt&gtouter.knum );

Here are all customers selected, which have more than one corresponding salesman.