SQL Aggregate Functions In Where Clause

SQL Aggregate Functions In Where Clause

SQL Aggregate Function In Where Clause return the maximum conditional value
of the record from a table.

Understand with Example

The Tutorial help you to understand an Example from 'SQL Aggregate
Functions'. To understand this, we create a table 'Stu_Table'. The create
table constructa table 'Stu_Table' with different Table attribute
specified in the query.

Next, we might want to conditionally select the data from a table. For
example, we may want to only retrieve stores with sales above $1,000. To do
this, we use the WHERE keyword. The syntax is
as follows:

Next, the given below Query want to return the
conditionally select the data from a table 'Stu_Table'. For example, we
want to retrieve the maximum value of the 'stu_id' with name search
specified in the 'Stu_Name'. In order to overcome, we use the WHERE clause.
The Syntax is given below:

selectmax(stu_id) from stu_table
where stu_name in('komal','ajay','santosh','rakesh');