Golang Tutorials - Learn Go Programming with Easy Step-by-Step Guides

Explore comprehensive Golang tutorials for beginners and advanced programmers. Learn Go programming with easy-to-follow, step-by-step guides, examples, and practical tips to master Go language quickly.

Where Condition In Sql in SQL

Where Condition In Sql in SQL

The WHERE condition in SQL is used to filter records based on a specified criterion. It helps you retrieve, update, or delete only those rows that meet certain conditions.


What is the WHERE Condition?

  • It’s a clause that follows SELECT, UPDATE, or DELETE.

  • Defines the criteria that rows must satisfy to be affected or retrieved.

  • Supports various operators and expressions.


Basic Syntax

SELECT column1, column2, ...FROM table_nameWHERE condition;

Common Operators Used in WHERE

OperatorDescriptionExample
=Equal toWHERE Age = 30
<Less thanWHERE Price < 100
>Greater thanWHERE Salary > 50000
<=Less than or equal toWHERE Date <= '2025-06-01'
>=Greater than or equal toWHERE Score >= 80
<> or !=Not equal toWHERE Status <> 'Active'
BETWEENWithin a rangeWHERE Age BETWEEN 18 AND 25
INMatches any value in a listWHERE Country IN ('US','CA')
LIKEPattern matchingWHERE Name LIKE 'J%'
IS NULLChecks for NULL valuesWHERE EndDate IS NULL

Example Queries

-- Select employees older than 30SELECT * FROM EmployeesWHERE Age > 30;-- Select orders placed in 2025SELECT * FROM OrdersWHERE OrderDate BETWEEN '2025-01-01' AND '2025-12-31';-- Select customers from USA or CanadaSELECT * FROM CustomersWHERE Country IN ('USA', 'Canada');-- Select products with name starting with 'A'SELECT * FROM ProductsWHERE ProductName LIKE 'A%';

If you want, I can help you build more complex WHERE conditions or explain specific use cases!

Disclaimer for AI-Generated Content:
The content provided in these tutorials is generated using artificial intelligence and is intended for educational purposes only.
html
docker
php
kubernetes
golang
mysql
postgresql
mariaDB
sql