易截截图软件、单文件、免安装、纯绿色、仅160KB

日程安排生成的sql语句

select *
from
(select [id]=row_number() over (order by getdate()),
        date=convert(varchar(8),dateadd(dd,number,'2010-01-01'),112)
        from
        (select number from master..spt_values where type='p' )t ) X
join
(select '1' as id, 'A' as Col1 union all
  select '2' as id,'B' as Col1 union all
  select '3' as id ,'C' as Col1
  ) Y
on x.id % ( select count(*) + 1
 from ( select '1' as id union all
        select '2' as id union all
        select '3' as id ) M)
=y.id
order by x.id


相关文档:

oracle PL/SQL 中常量和变量的声明

 
一、常用数据类型:
Number:数字类型
Int:整数型
Pls_integer:整数型,产生溢出的错误
Binary_integer:整数型
Char:定长字符,最长255个字符
Varchar2:变长字符,最长2000个字符
Long:变长字符,最长2GB
Date:日期型
Boolean:布尔型
二、定义常量
格式:常量名   constant &nbs ......

个人总结的几条比较有意思的sql语句


 
--------------------------------------------------------------------
-- 作者:张爱国
-- 日期:2010-01-23 15:00:17
-- 描述: 一些比较有意思的SQL语句
-- Version:
--    Microsoft SQL Server 2005 - 9.00.3042.00 (Intel X86)
--    Feb  9 2007 22:47:0 ......

Linq 与sql方式 添加数据效率比较

所测试环境为:Ms sqlserver 2008,visual studio 2008
测试数据为10万条
 Linq方式 代码:
/// <summary>
/// Linq 方式
/// </summary>
public static void Linq_insert()
{
DataClassesDataContext dataContext = new DataClassesDataContext();
......

sql语句查询怎么判断查询结果为空?

sqldataadapter适合用在查询较多字段时.....
string sou = "select * from art where content like '%" + TextBox1.Text + "%'";
SqlDataAdapter da = new SqlDataAdapter(sou, conn);
DataSet ds = new DataSet();
da.Fill(ds);
if (ds.Tables[0].rows.count==0)
{
Response.Write("没有记录!");
}
else
{
......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号