dotConnect for PostgreSQL Documentation
Devart.Common Namespace / SelectStatement Class / AddHavingCondition Method
A new condition to add.
Example

AddHavingCondition Method
Adds new condition to HAVING clause of the statement, represented by the Having property.
Syntax
'Declaration
 
Public Sub AddHavingCondition( _
   ByVal condition As String _
) 
 

Parameters

condition
A new condition to add.
Remarks
If the Having property is not empty, the new condition is concatenated using AND keyword.
Example
The following example demonstrates how to use the AddHavingCondition method.
PgSqlSelectStatement stmt = new PgSqlSelectStatement();
stmt.Columns.Add(new SelectColumn("EMP"));
stmt.Columns.Add(new SelectColumn("SAL"));
stmt.Tables.Add(new SelectTable("emp"));

stmt.AddHavingCondition("SAL > 1000");

//select JOB,SAL from emp having SAL > 1000
PgSqlCommand command = new PgSqlCommand(stmt.ToString());
Dim stmt As New PgSqlSelectStatement
stmt.Columns.Add(New SelectColumn("EMP"))
stmt.Columns.Add(New SelectColumn("SAL"))
stmt.Tables.Add(New SelectTable("emp"))
stmt.AddHavingCondition("SAL > 1000")

'select JOB,SAL from emp having SAL > 1000
Dim command As New PgSqlCommand(stmt.ToString)
See Also