EXISTS Predicate (SQL)

Help Contents

Introduction

The SQL EXISTS Predicate tests whether a relationship with a sub-query returns a non-empty result.

Syntax

exists-predicate ::=
  EXISTS ( sub-query )

Syntax Details

sub-query is a valid Query Expression.

Examples

To find channels that have one or more Siemens S7 PLCs associated with the channel:

SELECT FullName,StateDescription
FROM TagChannel AS C
WHERE EXISTS (Select * from SiemensS7PLCSerial AS D WHERE C.FullName = D.Channel)

Further Information

Predicates

To learn about other types of predicate.

Fernhill SCADA Structured Query Language (SQL)

To learn more about the SQL features in Fernhill SCADA.

Glossary

For the meaning of terms used in Fernhill SCADA.