Home > database > A simple SQL query problem of primary amateurs
A simple SQL query problem of primary amateurs
Time:09-29
Find all the capital and the country name, and in the capital have the country name, The select capital, name the from world
Where the name in (capital) should I write the correct answer is the following
Capital name Andorra la Vella Andorra Djibouti Djibouti Guatemala City, Guatemala Kuwait City, Kuwait Luxembourg Luxembourg Mexico City, Mexico Monaco Ville - Monaco Panama City, Panama San Marino San Marino Singapore Singapore
CodePudding user response:
Please post table structure, the test data of the script...
CodePudding user response:
The select capital, name the from world Where charindex (name, capital) & gt; 0
CodePudding user response:
Capital name Kabul Afghanistan Tirana Albania Algiers Algeria Andorra la Vella Andorra Luanda Angola St. John 's Antigua and Barbuda Buenos Aires Argentina Yerevan Armenia Canberra Australia Vienna Austria Baku Azerbaijan Nassau last Manama Bahrain Dhaka Bangladesh Bridgetown Barbados In Minsk Belarus The City of Brussels Belgium Belmopan Belize Porto Novo Benin - Thimphu Bhutan Sucre can Sarajevo Bosnia and Herzegovina Gaborone Botswana Brasilia Brazil Bandar Seri Begawan Begawan Brunei Sofia Bulgaria Ouagadougou Burkina Faso Bujumbura Burundi Up Phnom Penh Cambodia Yaounde Cameroon Ottowa Canada Praia Cape Verde Bangui Central substitutes Republic N 'Djamena Chad Santiago Chile Beijing China Reuters Colombia Moroni Comoros The United States today Kinshasa, Congo Republic of Brazzaville, Congo Republic of San Jose Costa Rica Yamoussoukro C? Te d 'Ivoire Zagreb Croatia And Havana Cuba Nicosia Cyprus The incapable Czech Republic Copenhagen Denmark, Djibouti Djibouti Roseau Dominica Santo Domingo Dominican Republic