In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces how to use SELECT statements with more than two tables in Oracle database. It is very detailed and has certain reference value. Friends who are interested must finish reading it.
Connections in the Oracle database can be used to join any number of tables. The following formula calculates the number of connections needed in the WHERE clause:
The total number of tables used in the query minus 1.
To give you an example, this example involves four tables, so three connections are required. Suppose you want to see the following information: 1. The customer who has purchased the product 2, the name of the customer 3, the product name 4, and the product type name
In order to view this information, you need to query the foreign key relationships between the four table 27 joins customers, purchases, products, and product_types. The required associations are as follows:
1. To get customers who have purchased products, you need to join the two tables using the customers_ id column in the customers and purchases tables.
two。 To obtain the products purchased by the customer, you need to join the two tables using the product_ id column in the purchases and products tables.
3. To get the product type name, you need to join the two tables using the product_type_id column in the products and product_ types tables.
Based on the above description, the query can use the following statement:
SELECT c. Firstbatch name, SELECT c. Lastcalendar name. Name, C-means examples, pr,products pcentage categories types ptWHERE c.customer_id=pr.customer_id AND p.product_id=pr.product_idAND p.productkeeper typecalendar. Productcategories. This is all of the article "how to use SELECT statements with more than two tables in Oracle database". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.