PHP Tutorials
- What is MySqli
- mysql query
- mysql query example
- InnoDB
- mysql column Type
- CRUD Example
- Connection Using Function
- mysql keys
- SELECT
- WHERE
- UPDATE
- Count no of Rows
- ALIAS
- AND, AND & OR
- BETWEEN
- COMPARISON OPERATOR
- DELETE
- DELETE LIMIT
- DISTINCT
- EXISTS
- FROM
- GROUP BY
- HAVING
- IN
- INTERSECT
- IS NULL & IS NOT NULL
- LIKE
- NOT
- ORDER BY
- SELECT LIMIT
- SUBQUERY
- TRUNCATE
- UNION && UNION ALL
- Concat & Group_Concat
- mysql Function
- Mysql Insert Id
- MySql Aggregate Function
- Mysql Join
- JOIN in MySql
- Trigger
- Procedure
- Transaction
- views
- Index
- SQL Injection
- Normalization
- Query Bind
- Interview Questions
Important Link
Comparison Operators
Comparison operators are used in the WHERE clause to determine which records to select.
= :-Equal
<=> :-Equal (Safe to compare NULL values)
<> :-Not Equal
!= :-Not Equal
> :-Greater Than
>= :-Greater Than or Equal
< :-Less Than
<= :-Less Than or Equal
IN ( ) :-Matches a value in a list
NOT :-Negates a condition
BETWEEN :-Within a range (inclusive)
IS NULL :-NULL value
IS NOT NULL :-Non-NULL value
LIKE :-Pattern matching with % and _
EXISTS :- Condition is met if subquery returns at least one row
not equal to (<>, !=) operator
SELECT id,name,country FROM Empployee
WHERE country <>"India";
GREATEST() function
GREATEST() function returns the greatest of the given arguments.
SELECT item_name
FROM items
WHERE price>GREATEST(200,300,395);
COALESCE() function
MySQL COALESCE() function returns the first non-NULL value of a list, or NULL if there are no non-NULL values.
SELECT pub_NAME,COALESCE(estd,country,pub_city)
FROM newpublisher;
select id,title,date from ittutorial where COALESCE(title,'')<>'W'
select id,title,date from ittutorial where title IS NULL OR title=''";