Fetch First Clause (SQL)

Help Contents

Introduction

The SQL Fetch First clause sets the number of rows to return in the query result.

Syntax

fetch-first-clause ::=
  FETCH { FIRST | NEXT } [ row-count ] { ROW | ROWS }

Remarks

row-count is an optional constant integer value or parameter that is greater than or equal to one. The value sets the maximum number of rows to return in the query result. If row-count is omitted, the maximum rows returned in the query result is one.

The keywords FIRST and NEXT are synonyms.

The keywords ROW and ROWS are synonyms.

Examples

To fetch the first 5 digital tags:

Select FullName,Value,Quality
From TagDataPointDigital
Fetch First 5 Rows

Further Information

Fernhill SCADA SQL

To learn more about the SQL features in Fernhill SCADA.

Glossary

For the meaning of terms used in Fernhill SCADA.