sql 列名问题
--引用别名要这样使用
select *
from
(select a as 数量1,b as 数量2
form table)t
where 数量1>数量2
改为
select
*
from
(select b.mc as 客户名称,c.pm as 品名,convert(char(20),kdrq,102) as 购买日期,
convert(char(10),dateadd(day,cast(zy1 as int),kdrq),102) as 提醒日期, --char(10)就行了
sl as 数量,a.je as 金额,ml as 毛利
from jzxsd a,cskh b,spbmzd c,cskhlb d
where b.dwlb=d.lbbh and a.dwbh =b.dwbh and a.hh=c.hh and c.zy1<>''and b.khlx=0)T
where 提醒日期=convert(char(10),getdate(),102)
select *
from
(select a as 数量1,b as 数量2
form table)t
where 数量1>数量2
改为
select
*
from
(select b.mc as 客户名称,c.pm as 品名,convert(char(20),kdrq,102) as 购买日期,
convert(char(10),dateadd(day,cast(zy1 as int),kdrq),102) as 提醒日期, --char(10)就行了
sl as 数量,a.je as 金额,ml as 毛利
from jzxsd a,cskh b,spbmzd c,cskhlb d
where b.dwlb=d.lbbh and a.dwbh =b.dwbh and a.hh=c.hh and c.zy1<>''and b.khlx=0)T
where 提醒日期=convert(char(10),getdate(),102)
佚名
2024-05-26 03:15:45
类似问题(10)
-
佚名2024-05-26 00:13:05
问康师傅干脆面系列问题
答康师傅脆奇,或者是小虎队。
-
佚名2024-05-26 12:36:46
问SQL Server 设计表的问题 列的别名
答可以在单独的一个表中存储,别名表(表名,列名,列别名) ,用时从这个表中调用。
-
佚名2024-05-26 16:29:35
问SQL为列起别名语句写在哪段代码里
答select [列名] as [列别名] from tableName请试一试上面的写法,就是为列名取表名如有疑问,及时沟通!
-
佚名2024-05-26 22:14:40
问如何解决SQL SERVER 中列名无效
答1、在列名上右击,选择里面的修改,然后点击。2、 点击完毕之后,我们这里可以看到的是在两侧的列名值是一样的 。3、这里我们将StudentName这一列中的最...
-
佚名2024-05-26 00:54:44
问在sql中建表时怎么给列起名
答CREATE TABLE 表名称(列名称1 数据类型,列名称2 数据类型,列名称3 数据类型,....)
-
佚名2024-05-26 08:00:00
问关于GTA4一系列问题
答首先麻烦您提供您的操作系统信息,其次您需要去微软网站或者百度下载NET.Framework 2.0
-
佚名2024-05-26 08:00:00
问sql语句问题
答一:select * from A表 where B is null or C is null or D is null; (如果是空字符串 B='' or C...
-
佚名2024-05-26 08:00:00
问SQL怎么改列的长度?
答sql语句修改字段长度:alter table <表名> alter column <字段名> 新类型名(长度)结构化查询语言(Structured...
-
佚名2024-05-26 08:00:00
问北京交通大学一系列问题......
答1不怎么样,四川人会觉得大部分分都很难吃。大部分会偏咸。不过食堂的水平在北京各大高校中也起码中等以上2最差的情况是八人间,可能住7人,其中一张床放东西。是没空调...
-
佚名2024-05-26 08:00:00
问sql临时表的问题!!!!!!!!!
答如果再通过记录集读数据,是不是在同一个会话里面啊?还是 会话 中间 结束过一次了?SQL Server2种:本地临时 全局临时1> -- 本地临时表.2> CR...