To instruct Oracle to use a column alias, you simply list the column alias next to the column name in the SELECT clause as shown below:. The AS keyword is used to distinguish between the column name and the column alias.
Because the AS keyword is optional, you can skip it as follows:. By default, Oracle capitalizes the column heading in the query result. Otherwise, you must enclose the column heading in quotation marks or you will get an error. In this example, we used the column aliases "First Name" and "Family Name" enclosed in quotation marks.
The subquery must return exactly one row and one column. The subquery must return exactly one row that includes all the columns listed. The column values returned by the subquery are assigned to the columns in the column list in order. Yes - it also works. Thanks for your response. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password.
Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science. Stack Gives Back Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually. Sign in to vote.
Hi, While checking a stored procedure, I found an Update statement that I think it will somehow fail to update the correct row. SQL Server that we are using is declare tbl1 table id int, name varchar 20 declare tbl2 table id int, name varchar 20 insert into tbl1 select 1, null insert into tbl1 select 2, null insert into tbl1 select 3, null insert into tbl2 select 1, 'JOHN' insert into tbl2 select 2, 'ARMI' insert into tbl2 select 3, 'TAN' The Update Statement in SP is something like this and yet when I did the test, it is working fine and updating the correct records.
Friday, May 18, AM. I thought it should use the alias in Update Statement. Marked as answer by shadow-fire Friday, May 18, AM.
0コメント