Suppose I have a table with columns id, name, contact
.
What difference is there by getting the data with
SQL query #1:
SELECT *
FROM table
and SQL query #2:
SELECT id, name, contact
FROM table
Suppose I have a table with columns id, name, contact
.
What difference is there by getting the data with
SQL query #1:
SELECT *
FROM table
and SQL query #2:
SELECT id, name, contact
FROM table
SELECT * FROM table - its will select all column even if those are useful or not. if you selecting all the column than some memory overhead and time consuming. For example , suppose you are selecting all the column and storing in some java object then this is not useful instead of this select those column which is useful for your operation.