SELECT STATEMENTS IN SQL

teradata

SELECT is the most important SQL command in any RDBMS system. SELECT statement in SQL is used to select rows by executing SQL queries. Once the result set in built as per SQL Queries , SELECT command will retrieve only those columns which are mentioned in the SELECT clause. SELECT portion of any SQL Queries operates at the last after complete result set is built. The basic structure of any SELECT query is:

SELECT columns FROM table;

SELECT ALL ROWS FROM A TABLE: Using the above Query Structure we will write a simple SQL Query to retrieve all the rows from the table CUSTOMERS. To SELECT all rows from customers table use below query:

SELECT CUST_ID, CUST_NAME,CUST_CITY,CUST_OPERATOR FROM CUSTOMERS;

Below is the Result-Set

SELECT STATEMENT IN SQL

Leave a Reply

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