Page 5 - Simple Queries in SQL
P. 5

Selecting content of some columns
                     select ename, job, hiredate from employee;
                    Command to select data of some columns




















               Ordering of columns
               The column headings in the output table of a SQL command is in the same order as that of select
               command, nothing changes in original table.

               select ename, hiredate, job from employee;


















                                                    .


               To display data from all the columns:
               Syntax:   select * from table_name;
                                 Select * from employee;

               ALL/DISTINCT Clause
               Distinct eliminates duplicate/redundant rows.


                     Select [ALL | DISTINCT] <col list> from table;
                       (default is ALL)

                       select distinct job
                       from employee;
                       select job from employee;
                       (is equivalent to)
                       select ALL job from employee;
   1   2   3   4   5   6   7   8   9   10