|
-
If you created tables with embedded spaces then you need double quotes to let Oracle know that there are embedded spaces in the table name and columns for example:
Code:
SELECT "Retail Tran DateTime", "Product Department Name",
"Product Quantity", "Product Retail Price"
from "Product Sales Detail"
where product department name = 'Meter'
and retail tran datetime = dateadd(day, -1, current_timestamp)
order by retail tran datetime;
Here is the Access/SQL Server version of the above. Basically you can have select columnName columnAlias, columnName2 columnAlias2, etc
you can't have select column name aliasbecause Oracle would need to know that column is the name of the column and name is the alias or that column name is the name of the column with no alias. The as is optional.
Code:
SELECT [Retail Tran DateTime], [Product Department Name],
[Product Quantity], [Product Retail Price]
from [Product Sales Detail]
where product department name = 'Meter'
and retail tran datetime = dateadd(day, -1, current_timestamp)
order by retail tran datetime
GO
Hence you use double quotes. Although you are better off not using double quotes in tables at all. It makes it much easier. Because if you do use double quotes, then you can do the following:
create table system."mYtAbLe" (
"column1" VARCHAR2(4000),
"Column1" VARCHAR2(4000),
"cOlumn1" VARCHAR2(4000),
"colLmn1" VARCHAR2(4000),
"coluMn1" VARCHAR2(4000),
"columN1" VARCHAR2(4000) );
create table system."MyTaBlE" (
"column1" VARCHAR2(4000),
"Column1" VARCHAR2(4000),
"cOlumn1" VARCHAR2(4000),
"colLmn1" VARCHAR2(4000),
"coluMn1" VARCHAR2(4000),
"columN1" VARCHAR2(4000) );
You can have both tabes in the same schema in the same database. You can even store almost any data type in any of the columns. But your database would be a mess.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|