SQL查询问题。
SQL code:
strListSql = "SELECT Money.ID AS Money_ID,Money.CustomNO AS Custom_NO,Custom.SeriesType as Custom_Flag,Custom.M_Name as Custom_M_Name,"
strListSql = strListSql & " Custom.F_Name AS Custom_F_Name, Custom.Series AS Custom_Series,"
strListSql = strListSql & " Custom.SeriesPrice AS Custom_SeriesPrice,"
strListSql = strListSql & " Money.Date AS Money_Date, Money.Shroff AS Money_Shroff,Money.CustomType AS Money_CustomType,"
strListSql = strListSql & " Money.Type As Money_Type,Money.PayType AS Money_PayType, Money.Money AS Money_Money, Money.Remark AS Money_Remark "
strListSql = strListSql & " from Custom LEFT JOIN Money ON Custom.CustomNO=Money.CustomNO "
strListSql = strListSql & " ORDER BY Money.Date DESC"
有上面的一段SQL,这样列出来是没问题的,但是后来发现系统入帐列不出来,原来是系统入帐没有相庆的CustomNO,怎么样才能列出来,列为表中的“Remark”值为"系统入帐"。主要是" from Custom LEFT JOIN Money ON Custom.CustomNO=Money.CustomNO "这个地方,怎么样加一个,能单独把Money.Remark="系统入帐"的也列出来.谢谢。
ON Custom.CustomNO=Money.CustomNO or Money.Remark='系统入帐'
不过这样Money.Remark='系统入帐'和Custom的记录怎么对应?
不是。主要问题是系统入
相关问答:
执行的顺序:
1)文件浏览框(选择文件使用)
选择好文件后
点击一个导入按钮的时候 ,把上面上传框里的csv文件以一个ID为文件名,上传到**/**文件夹下
2)读取这个文件夹下的csv的文件,转换成sql
3 ......
今天做了一个存储过程 环境是SQL2000数据库
大致如下
建立临时表
定义员工游标
循环员工(属于1个公司)
......
我们C#做一个窗体 往数据库里插入数据
SqlConnection cn = new SqlConnection("Data Source=20090713-1752\\SQLEXPRESS;Initial Catalog=goods;Integrated Security=True");
......
sqlserver2005 建立的数据库,与手持pda传输数据,最近突然出现无法传递数据的问题,pda端提示的错误时outofmemoryexception,但是pda上面的容量没有问题,
sqlserver的日子上的错误如下:
日期 2010-1-25 14:45: ......