Condition (SQL)
   HOME

TheInfoList



OR:

A
relational database management system A relational database is a (most commonly digital) database based on the relational model of data, as proposed by E. F. Codd in 1970. A system used to maintain relational databases is a relational database management system (RDBMS). Many relatio ...
uses SQL conditions or expressions in clauses and in clauses to subsets of data.


Types of condition

* Many conditions compare values for (for example) equality, inequality or similarity. * The EXISTS condition uses the SQL standard keyword EXISTS to determine whether rows exist in a subquery result.


Examples

To one row of data from a table called ''tab'' with a primary key column (''pk'') set to 100 — use the condition ''pk = 100'': SELECT * FROM tab WHERE pk = 100 To identify whether a table ''tab'' has rows of data with a duplicated column ''dk'' — use the condition ''having count(*) > 1'': SELECT dk FROM tab GROUP BY dk HAVING count(*) > 1


References

{{DEFAULTSORT:Condition (Sql) SQL Articles with example SQL code