another way, analyzed. has the following data: (in order to see more clearly, I did not use the country code, but directly with the country name as primary Key)
Country (country)
Population (population)
China
600
United States
100
Canada
100
United Kingdom
200
France
300
Japan
250
Germany
200
Mexico
50
50
India
250
Now to count the number of people on each continent, you can use the following statement:SELECT SUM (population), case country when ' China ' Then ' Asia ' when ' India ' then ' Asia ' when ' Japan ' Then ' Asia ' When ' us ' then ' North America ' when ' Canada ' Then ' Nort
United States
100
Canada
100
UK
200
France
300
Japan
250
Germany
200
Mexico
50
India
250
expected query results:
Chau
Population
Asia
1100
North america
250
Other
700
', 80)INSERT into Testscore values (' John Doe ', ' English ', 90)Select Tname as ' name ',Max (case ttype "language" then Tscor else 0 end) ' Language ',Max (case ttype when ' math ' then Tscor else 0 end) ' Math ',Max (case ttype when ' English ' then Tscor else 0 end) ' English 'From TestscoreGROUP BY TnameExample TwoThere is the following data: (in order to see more clearly, I did not use the country code, but directly with the country name as primary Key)
Country (country)
: (for better understanding, I did not use country code, but directly use the country name as the Primary Key)
Country population (population)
China 600
US 100
Canada 100
UK 200
France 300
Japan 250
Germany 200
Mexico 50
India 250
The population of Asia and North America is counted based on the population data of this country. The following result is returned.
Continent population
Asia 1100
North America 250
Other 700
What do you do if you want to
never get the result of the second type.
The Code is as follows:
Case when col_1 IN ('A', 'B') then' first class'
WHEN col_1 IN ('A') then' Second Class'
ELSE 'others' END
Let's take a look at what we can do with the Case function.
1. Known Data is grouped and analyzed in another way.
There are the following data: (for better understanding, I did not use country code, but directly use the country name as the Primary Key)
Country population (population)
China 600
US 100
Canada 100
UK 200
France
Time zone conversion
The server is located in the United States, but the customer is located in India. Therefore, the local time/server time must be converted to the Indian time. The Code is as follows:
Convert the local time zone to the Indian time zone:
String indianTime = string. Empty;
DateTime localTime = DateTime. Now;
IndianTime = TimeZoneInfo. ConvertTimeBySystemTimeZoneId (localTime, "India
will be with you. in Buddhism, it is more interesting to say that this religion can be regarded as an "God-less" religion. it tells you that everything in the world is false. It is an illusion. even yourself is an illusion. You should not stick to the concept of "I" to reach the realm of "no. you feel terrible fear. The pain is because you keep thinking about "I". If you don't stick to "I", you will be relieved from the pain. or it can be said that all pain is no longer important. You can exper
;
The reform and opening up have dramatically changed all over China. As China joins the WTOThe huge market potential in China has attracted more and more world-leading software companies to enter us.China's software market has become an international competitive market. Compared with India, ChinaThe international level of software enterprises is far from enough.We are lagging behind in terms of management level. We have to work hard and stick to the
lines of code in each module, which could be risky. According to their company's productivity-300 rows/person-month, he figured out how many weeks the second phase of the project would take.
At that time, we raised an objection: 1) the company was in urgent need of the project; 2) whether there were too few 300 lines per month; 3) We still have source code references for downloading. He explained that 300 rows/person-month is the empirical data that enables the project to meet their quality sta
computer decomposition prime factor for almost many years. Modern number theory also involves the study of irrational numbers. The irrational number is essentially an infinite series. For example, the percentile of the circumference rate can be expressed as a triangular series, but it is not a unique representation. The computing efficiency of different representations varies greatly, in ancient China, the mathematician zu chongzhi calculated thousands of polygons to determine the accuracy of t
that he had reached the third realm of life, secular feelings and complexity.Miscellaneous cannot shake him any more. Therefore, I wrote a poem to the Buddha and India Zen masters: "The first day of the review, the great light shines like a thousand; the eight winds do not move, the end is sitting on the purple Golden Lotus ." The so-called "Eight winds cannot be moved" refers to the destruction of gains and losses in the world.It has no effect on hi
development enterprise qualification certificate to the technical standard because of many project bidding in China, such as the need to pass the CMMS 3. When I was just promoted to PM, agje was beaten by Indians because he wanted to compete with a software outsourcing company in India for a domestic OSS project. However, the most internationally certified CMM companies are in India. Indians love CMM/cmme
(population)
China
600
USA
100
Canada
100
UK
200
France
300
Japan
250
Germany
200
Mexico
50
India
250
The population of Asia and North America is counted based on the population data of this country. The following result is returned.
Continent
Population
Asia
1100
North America
250
Others
70
29 PHP Excel Processing classes, 29excel
The following PHP Excel processing classes, including Excel read-write, import and export, and other related classes, the list is as follows:
PHP Excel Reader Classes
1. Read Excel spreadsheets using COM
Umesh Rai (India)
2. Read Excel Binary. XLS Files in Pure PHP
Ruslan v. Uss (Russian Federation)
3. Read Excel spreadsheets using ODBC
Khalil Majdalawi (Jordan)
4. Read Excel worksheets in XML format (. XLSX)
use country code, but directly use the country name as the Primary Key)
Country)
Population (population)
China
600
USA
100
Canada
100
UK
200
France
300
Japan
250
Germany
200
Mexico
50
India
250
The population of Asia and North America is counted based on the population data of this country. The following result is returned.
the primary key)
country)
Population
China
600
USA
100
Canada
100
UK
200
France
300
Japan
250
Germany
200
Mexico
50
India
250
The population of Asia and North America is counted based on the population data of this country. The following result i
. On the day of labba, in addition to offering worship to the ancestors, there are also mourning for the country and mourning. (World Food Network)
Legend of LABA porridge
In lunar December 8, Chinese people had the habit of eating LABA porridge. It is said that LABA porridge is transmitted from India. The father of Buddhism, Sakyamuni, was the son of the king of the final meal of the gviro Wei (now in Nepal) in Northern
seek gold, india's IT enterprises want to replicate their local success global IT outsourcing model to China. Second, the cost of Chinese software talents is lower than that of India.
India's software industry has developed rapidly over the past decade. The wage cost of employees increases by 20% to every year. In addition to opening up the market in China, an important factor is China's human resource cost advantages. Currently, the average salary
label: Io data SP Div C on r bs as Country Population China 600 US 100 Canada 100 UK 200 France 300 Japan 250 Germany 200 Mexico 50 India 250 the population of Asia and North America is counted according to the population data of this country. Select sum (Population ), case country when 'China' then' Asia 'when' India 'then' Asia 'when' Japan 'then' Asia 'when' USA 'then' North America 'when' Canada 'then'
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.