SQL WHERE Condition:
SQL WHERE Condition is used to filter records.
This condition is show only those record as per specified in where condition.
Syntax:
SELECT column_name
FROM table_name
WHERE column_name operator value;
Table: 'Student'
| StudentID | StudentName | Address | Country |
|---|---|---|---|
| 1 | Ajay | Noida | India |
| 2 | Ajeet | Bareilly | India |
| 3 | Shivam | Nagaland | India |
Example:
SELECT *
FROM Student
WHERE Address ='Bareilly';
Text Value vs. Numeric Value:
- In SQL text values definition requires single quotes around (most database systems will also allow double quotes).
- Numeric value definition not required.
Text Value vs. Numeric Value:
- In SQL text values definition requires single quotes around (most database systems will also allow double quotes).
- Numeric value definition not required.
After executing this statement, it result is
| StudentID | StudentName | Address | Country |
|---|---|---|---|
| 2 | Ajeet | Bareilly | India |
Conversion Conversion Emoticon Emoticon