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

sql 命名问题

正确的:select isnull(money,0) from (select  sum(money) as money,3 as b from zhangbenjilu where datepart(month,usedatetime)=3) as a
错误的:select isnull(money,0) from (select  sum(money) as money,3  from zhangbenjilu where datepart(month,usedatetime)=3)


相关文档:

总结SQLite不支持的SQL语法有哪些


1 TOP
这是一个大家经常问到的问题,例如在SQLSERVER中可以使用如下语句来取得记录集中的前十条记录:
SELECT TOP 10 * from [index] ORDER BY indexid DESC;
但是这条SQL语句在SQLite中是无法执行的,应该改为:
SELECT * from [index] ORDER BY indexid DESC limit 0,10;
其中limit 0,10表示从第0条记录开始,往后 ......

SQL 2005 xml 处理的一些sample

USE Test
--Create 2 tables as an example
CREATE TABLE ExampleTable
(
[ID] int PRIMARY KEY
,[Name] nvarchar(256)
)
CREATE TABLE ExampleTable2
(
[ID] int PRIMARY KEY
,[Name] nvarchar(256)
)
----way1
SELECT *
from sys.objects [table]
WHERE
[Name] LIKE 'ExampleTable%'
FOR XML AUTO, ROOT ......

sql简单函数用法

定义函数
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER function [dbo].[FunJSLC](@carid bigint,@date datetime)
returns decimal
as
begin
declare @jslc decimal
set @jslc=(select JSLC from BYReMIn where iCarID=@carid and dtDate=@date)
return(@jslc)
end
存储过程应用函数
set ANSI_NULLS ......

SQL MINUS的用法


< type="text/javascript">
document.body.oncopy = function() {
if (window.clipboardData) {
setTimeout(function() {
var text = clipboardData.getData("text");
......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号