Cheap VPS & Xen Server

Residential Proxy Network - Hourly & Monthly Packages

MySQL AND


The MySQL AND condition is used with SELECT, INSERT, UPDATE or DELETE statements to test two or more conditions in an individual query.

Syntax:

  1. WHERE condition1
  2. AND condition2
  3. AND condition_n;

Parameter explanation:

condition1, condition2, … condition_n: Specifies all conditions that must be fulfilled for the records to be selected.

MySQL AND Example

The following example specifies how to use the AND condition in MySQL with SELECT statement.

Consider a table “cus_tbl”, having the following data:

mysqland1

Execute the following query:

  1. SELECT *
  2. FROM cus_tbl
  3. WHERE¬†cus_firstname¬†=¬†‘Ajeet’
  4. AND cus_id > 3;

Output:

mysqland2

Comments

comments