SQL Select WHERE clause

teradata

We may come across requirements in which we need only few records from the table based on some sql condition. Only those records that satisfy the search condition should be retrieved from the table. In such cases, we should use SQL WHERE clause to specify the search condition. The syntax is given below:

SELECT column1, column2 FROM table WHERE column1=’some value’;

Using the above format of the query, if we need to fetch all the records for CUST_CITY is ‘BANGALORE’ , we may use below query:

SELECT CUST_ID, CUST_NAME,CUST_CITY, CUST_OPERATOR FROM CUSTOMERS WHERE CUST_CITY=’BANGALORE’;

SQL SELECT WHERE CLAUSEIn Teradata, searches are case-insensitive by default. So ‘Bangalore’ ,’BANGALORE’ or ‘BanGAlore’ all means the same value. However if you have to do some case specific searches , click here to read the method in Teradata.

Leave a Reply

Your email address will not be published. Required fields are marked *