Where Syntax for SELECT Query in Mysql

Where Syntax in Select Query can be used to filter the data from database.Suppose if you have 100 of data with different gender like male and female but you want the data of all male what you can do?

Simply use mysql select query with where condition to filter the data from table.


Example Table : For your reference



table_name
Column_name1
Column_name2
Column_name3
Column_name4
1
Male
articles
Sam
2
Female
database
Sam
3
Male
coding
Jam
4
Male
coding
Kam
5
Female
coding
Jam

Table Name is : table_name

Query : "SELECT * from table_name WHERE Column_name2='Male'"

If you execute the above query then all female records will disappears from the table data

table_name
Column_name1
Column_name2
Column_name3
Column_name4
1
Male
articles
Sam
3
Male
coding
Jam
4
Male
coding
Kam


Query : "SELECT Column_name3 , Column_name4  from table_name WHERE Column_name2='Male'"

If you execute the above query then all female records will disappears from the table data and will display only Column_name3 and Column_name4 

table_name
Column_name3
Column_name4
articles
Sam
coding
Jam
coding
Kam






Comments

Popular posts from this blog

Five More Indian Languages - Google Translate

Connect To JioFi Device Without Knowing The Passwords Using WPS