Node.js MySQL WHERE

Node.js MySQL WHERE is used to filter the selection of MySQL SELECT FROM statement records based on a condition applied to one or more columns of the TABLE.

Node.js MySQL WHERE

We shall learn to filter records of a table using following Node.js examples

We shall use the following MySQL Table, in the examples of this section [DATABASE : studentsDB, Table: students]

 

Example for Node.js MySQL WHERE with filter applied on a column

We shall apply a filter based on marks and fetch only those records with marks greater than 90.

Open a terminal from the location of above .js file and run selectFromWhere.js Node.js MySQL example program.

 

Example for Node.js MySQL WHERE to use Escaping Query Values

Records may contain data with escaping values like space characters. Following Node.js MySQL example program helps you to filter records based on values containing escaping characters.

Open a terminal from the location of above .js file and run WhereEscapingValues.js Node.js MySQL example program.

 

Example for Node.js MySQL WHERE with filter applied on two columns

We shall apply a filter based on marks and fetch only those records with marks greater than 90 and rollno less than 8.

Open a terminal from the location of above .js file and run selectFromWhere.js Node.js MySQL example program.

 

Conclusion :

In this Node.js TutorialNode.js MySQL Module Section – Node.js MySQL WHERE – We have learned to filter the selection of MySQL SELECT FROM statement records based on a condition applied to one or more columns of the MySQL Table.