数据库,如何根据我的记录获取最新日期 [英] Database, how to get the latest dates based on my records

查看:105
本文介绍了数据库,如何根据我的记录获取最新日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,程序员,这里有一个问题,假设我有一个带有此列的表

Hello programmers, got a question here supposed I have a table with this columns

CourseCategory               Course                  Date
I.T                          data management         2011
BSCS                         programming             2011
BSCS                         programming 2           2011
I.T                          hardware management     2010
ACT                          technical               2011    
BSCS                         Writing                 2010


我的问题是如何根据上表获得最新日期(在这种情况下为2011年)?原因是我想要的是,当我明年创建另一个术语时,当前术语数据必须在创建时应用.有关此的任何教程吗?


My question is how can I get the latest date based on my table above, in this case 2011? Cause what i want is that when I create another term for next year the current term datas must be applied when I create it. Any tutorial regarding this?

推荐答案

使用以下查询:

Use the following query :

select Max(Date) from tablename where course='Writing'


这篇关于数据库,如何根据我的记录获取最新日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆