Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The example usage of sql conditional query statement

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "the example usage of sql conditional query sentence". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn the example usage of sql conditional query sentence.

The copy code is as follows:

/ / create the transcript create table result (stu_id varchar2 (20) not null, china number (9Power2) null, math number (9L2) null, english number (9L2) null); / / insert the data insert into result values ('0001Jing 60, 20); insert into result values (' 0002, 80); insert into result values ('0003, 20,085); select * from result / / conditional query select stu_id, (case when china > 80 then 'excellent' when china > = 60 then 'pass' when china80 then 'excellent' when math > = 60 then 'pass' when math80 then 'excellent' when english > = 60 then 'pass' when english

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report