oracle - SQL reduce duplicates in union clause -


For example, I have the following questions:

  select customers, from the country Select the country where the country = 'Germany' select the city from the suppliers, the country where the country = 'Germany' order by the city;   

As you can see that WHERE country = 'Germany' is repeated in both goals of the union - without query to reduce the query Is there any way to repetitions? I do not like my questions very long. I

I am currently working on Oracle.

why not WHERE only once

 < CODE> SELECT * (Select City, Select Country All Customers from Country, City by City Order by Country Order) Tab WHERE Country = 'Germany'   

(or) Code> Join as

  Selection as customer C. Customer, c. Desh, as a customer. Area as Supplier, S. Supplier Country = s.ountry and c.ountry = 'Germany' order c.City;    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -