网站首页 美食营养 游戏数码 手工爱好 生活家居 健康养生 运动户外 职场理财 情感交际 母婴教育 时尚美容

送分题,Oracle降序和升序

时间:2024-10-15 17:06:11

1、创建测试表,

create table test_name(id varchar2(20),name var艘早祓胂char2(20), birthday date);

送分题,Oracle降序和升序

2、插入测试数据;

insert into test_name values(1, 'aa', to_date('1990-01-02 10:10:50','yyyy-mm-dd hh24:mi:ss'));

insert into test_name values(2, 'bb', to_date('1987-02-02 10:01:25','yyyy-mm-dd hh24:mi:ss'));

insert into test_name values(3, 'cc', to_date('2000-01-25 09:01:25','yyyy-mm-dd hh24:mi:ss'));

commit;

送分题,Oracle降序和升序

3、编写语句,根据birthday字段进行升序;

select * from test_name t order by birthday;

送分题,Oracle降序和升序

4、编写语句,根据birthday字段进行降序;

select * from test_name t order by birthday desc;

送分题,Oracle降序和升序

© 2025 小知经验
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com