--计算当前月的实际天数 Create FUNCTION dbo.CalcDaysOfMonth (@time varchar(6)) RETURNS int AS BEGIN DECLARE @Days int DECLARE @Month int DECLARE @Year int SET @Year=SUBSTRING(@time,1,4) SET @Month=SUBSTRING(@time,5,6) if( @Month='1' OR @Month='3' OR @Month='5'
《MySQL常用命令1 / 29 MySQL 常用命令汇总 http://www.database8.com 2011-3-1 2 / 29 Mysql 常用命令 show databases; 显示数据库 create database name; 创建数据库 use databasename; 选择数据库 drop database name 直接删除数据库,不提醒 show tables; 显示表 describe tablename; 显示具体的表结构 select 中加上 disti
oracl 和db2 常用语法比较: 1、取前N条记录 Oracle:Select * from TableName where rownum <= N; DB2:Select * from TableName fetch first N rows only; 2、取得系统日期 Oracle:Select sysdate from dual; DB2:Select current timestamp from sysibm.sysdummy1; 3、空值转换 Oracle:Select
--高级查询在数据库中用得是最频繁的,也是应用最广泛的。 Ø 基本常用查询 --select select * from student; --all 查询所有 select all sex from student; --distinct 过滤重复 select distinct sex from student; --count 统计 select count(*) from student; select count(sex) from student; select count(dis
代码如下:DECLARE table TABLE ([Values] varchar(10)) Insert INTO table Select ‘AAA’ UNION ALL Select ‘CCC’ UNION ALL Select ‘EEE’ UNION ALL Select ‘DDD’ UNION ALL Select ‘BBB’ Select [RowID] = IDENTITY (int, 1, 1), * INTO # FROM table