Home » RDBMS Server » Server Administration » Re: what does .* do in SELECT TABLENAME.* FROM ...
Re: what does .* do in SELECT TABLENAME.* FROM ... [message #373790] Wed, 09 May 2001 14:49
Andrew again...
Messages: 270
Registered: July 2000
Senior Member
When you have a single table, then prefixing * with "tablename." has no effect.

select * from t1, t2;
Selecting * from 2 or more tables as above returns the columns based on the order which the tables appear in the FROM clause, so the resultset isn't the same as "FROM t2, t1"

select t2.*, t1.* from t1, t2
Specifying the prefix allows you to control the order in which the columns are returned, so changing to "from t2, t1" doesn't change the resultset.

select sysdate, 1, 'hello world', t2.*, t1.* from t1, t2
If you want to include any other fields as above, then prefixing is mandarory.
Previous Topic: adding a primary key column
Next Topic: Obtaining the Text of SQL Statements in PL/SQL
Goto Forum:
  


Current Time: Mon Dec 23 09:43:49 CST 2024