SQL
a57565587
java程序员
展开
-
SQL中 decode()函数简介
今天看别人的SQL时看这里面还有decode()函数,以前从来没接触到,上网查了一下,还挺好用的一个函数,写下来希望对朋友们有帮助哈! decode()函数简介:主要作用:将查询结果翻译成其他值(即以其他形式表现出来,以下举例说明);使用方法:Select decode(columnname,值1,翻译值1,值2,翻译值2,...值n,翻译值n,缺省值转载 2014-07-28 10:41:41 · 716 阅读 · 0 评论 -
查询表的最新记录
-- 方法1select a.* from table1 a where not exists(select 1 from table1 b where b.name=a.name and b.gdtime>a.gdtime)-- 方法2select a.* from table1 a转载 2016-04-13 17:21:58 · 619 阅读 · 0 评论