SQL> desc customer
Name Null? Type
----------------------------------------------------------------- -------- --------------------------------------------
CUSTOMER_ID NOT NULL NUMBER(6)
FIRST_NAME VARCHAR2(40)
LAST_NAME VARCHAR2(40)
EMAIL VARCHAR2(55)
DOB DATE
CITY VARCHAR2(50)
COUNTRY VARCHAR2(50)
ZIP VARCHAR2(10)
SQL> desc orders
Name Null? Type
----------------------------------------------------------------- -------- --------------------------------------------
ORDER_ID NOT NULL NUMBER(12)
ORDER_DATE DATE
ORDER_MODE VARCHAR2(8)
CUSTOMER_ID NUMBER(6)
ORDER_TOTAL NUMBER(8,2)
SQL> desc order_items
Name Null? Type
----------------------------------------------------------------- -------- --------------------------------------------
ORDER_ID NUMBER(12)
LINE_ITEM_ID NUMBER(3)
PRODUCT_ID NUMBER(6)
UNIT_PRICE NUMBER(8,2)
QUANTITY NUMBER(8)
natural joins
select c.customer_id,c.first_name,last_name,city,country,order_total
from customer c
natural join orders o;
returns errors as the common column "customer_id" is aliased.
ORA-25155: column used in NATURAL join cannot have qualifier
25155. 00000 - "column used in NATURAL join cannot have qualifier"
*Cause: Columns that are used for a named-join (either a NATURAL join
or a join with a USING clause) cannot have an explicit qualifier.
*Action: Remove the qualifier.
Error at Line: 1 Column: 7
remove the c.customer_id alias and it works fine :)
Subscribe to:
Post Comments (Atom)
Followers
About Me
- reiki
- Torrance, CA, United States
No comments:
Post a Comment