KD's transcript merger

Source: Internet
Author: User


There is a table with 3 fields in it: Chinese, maths, English. There are 3 records in the language 70 points, math 80 points, English 58 points, please use a SQL statement to query the three records and the following conditions display (and write your ideas):
Greater than or equal to 80 means excellent, greater than or equal to 60 means pass, less than 60 points means fail.
Display format:
English for Chinese mathematics
Pass Excellent fail



Create Table tab (yw int,
SX int,
yy int);

Insert into tab values (70,80,58);

Select (case when tab.yw>=80 then ' excellent '
When tab.yw>=60 then ' pass '
Else ' fail ' end) as language
(case when tab.sx>=80 then ' excellent '
When tab.sx>=60 then ' pass '
Else ' fail ' end) as mathematics
(case when tab.yy>=80 then ' excellent '
When tab.yy>=60 then ' pass '
Else ' fail ' end) as English

From Tab;



Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.