en Lopes
en Lopes

Reputation: 2133

Select ALL columns from a table + sysdate

I need to select all the columns from a table and then the SYSDATE, but I got an error:

00923. 00000 -  "FROM keyword not found where expected"


select *, sysdate from HOTEL_PSD WHERE HOTEL_PSD_ID = 608316502;

Upvotes: 1

Views: 1131

Answers (1)

Gordon Linoff
Gordon Linoff

Reputation: 1270091

Oracle requires a table alias with *, when it is not the only column reference in the SELECT.

I strongly recommend giving all tables aliases that are abbreviations for the table name, so:

select hp.*, sysdate
from HOTEL_PSD hp
where hp.HOTEL_PSD_ID = 608316502;

Oracle is the only database that I regularly use that has this requirement.

Upvotes: 3

Related Questions