Problem
You have a table and want to see all of the data in it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use the special “*” character and issue a SELECT against the table:
1 select *
2 from emp
The character “*” has special meaning in SQL. Using it will return
every column for the table specified. Since there is no WHERE clause
specified, every row will be returned as well. The alternative would be
to list each column individually:
select
empno,ename,job,sal,mgr,hiredate,comm,deptno
from emp
In ad hoc queries that you execute interactively, it’s easier to use
SELECT *. However, when writing program code it’s better to specify
each column individually. The performance will be the same, but by
being explicit you will always know what columns you are returning
from the query. Likewise, such queries are easier to understand by
people other than yourself (who may or may not know all the
columns in the tables in the query).