Computer Science > EXAM > ORACLE : How to create a join with the USING clause in Oracle? (All)
Use the USING clause to specify the columns for the equijoin where several columns have the same names but not same data types. Use the USING clause to match only one column when more than one co ... lumn matches. The NATURAL JOIN and USING clauses are mutually exclusive. Syntax: SELECT table1.column, table2.column FROM table1 JOIN table2 USING (join_column1, join_column2…); Explanation: table1, table2 are the name of the tables participating in joining. The natural join syntax contains the NATURAL keyword, the JOIN…USING syntax does not. An error occurs if the NATURAL and USING keywords occur in the same join clause. The JOIN…USING clause allows one or more equijoin columns to specify in brackets after the USING keyword. Example: Creating Joins with the USING clause in Oracle In this example, the LOCATIONS table is joined to the COUNTRY table by the country_id column (only column of the same name in both tables). Sample table: locations Sample table: countries SQL> SELECT location_id, postal_code, country_name 2 FROM locations 3 JOIN countries 4 USING (country_id); Copy Sample Output: POSTAL_CODE CITY REGION_ID COUNTRY_NAME ------------ ------------------------------ ---------- ------------------------- 00989 Roma 1 Italy 10934 Venice 1 Italy 1689 Tokyo 3 Japan 6823 Hiroshima 3 Japan 26192 Southlake 2 United [Show More]
Last updated: 1 year ago
Preview 1 out of 4 pages
Buy this document to get the full access instantly
Instant Download Access after purchase
Buy NowInstant download
We Accept:
Can't find what you want? Try our AI powered Search
Connected school, study & course
About the document
Uploaded On
Jan 02, 2024
Number of pages
4
Written in
All
This document has been written for:
Uploaded
Jan 02, 2024
Downloads
0
Views
45
Scholarfriends.com Online Platform by Browsegrades Inc. 651N South Broad St, Middletown DE. United States.
We're available through e-mail, Twitter, Facebook, and live chat.
FAQ
Questions? Leave a message!
Copyright © Scholarfriends · High quality services·