Some times if we want to update a table or query a table for multiple values in a single column we have to run our simple sql query multiple times. Suppose if you want to get an element value in a column of a table you normally run a select command as shown below.
SELECT * FROM `table1` where column='abc'
SELECT * FROM `table1` where column is 'abc'
But if we want to select multiple values of a given column the above statement will not work properly. We have to modify to accomplish that. We can use in SQL keyword to achive this. Below example shows on how to select multiple values in a given column.
SELECT * FROM `table1` where column in ( 'element1', 'element2', 'element3')
We can include as many element you want in those braces.
Latest posts by Surendra Anne (see all)
- Docker: How to copy files to/from docker container - June 30, 2020
- Anisble: ERROR! unexpected parameter type in action:
Fix- June 29, 2020
- FREE: JOIN OUR DEVOPS TELEGRAM GROUPS - August 2, 2019
- Review: Whizlabs Practice Tests for AWS Certified Solutions Architect Professional (CSAP) - August 27, 2018
- How to use ohai/chef-shell to get node attributes - July 19, 2018