数据库中加条件判断来决定显示的数值
类别: 数据库教程
SELECT jxc_yj_xzwz.clmc AS 物资名称, jxc_yj_xzwz.ggxh AS 规格型号,
CAST(jxc_yj_xzwz.sl AS int) AS 数量, ISNULL(scdwbmk.dwmc, \'\') AS 所属部门,
CASE jxc_yj_xzwz.syqk WHEN \'0\' THEN \'未使用\' ELSE \'使用\' END AS 使用情况,
SUBSTRING(CONVERT(varchar, jxc_yj_xzwz.rq, 20), 1, 10) AS 制造日期,
jxc_yj_xzwz.zdr AS 制单人, jxc_yj_xzwz.bz AS 备注
FROM jxc_yj_xzwz LEFT OUTER JOIN
scdwbmk ON jxc_yj_xzwz.bmbm = scdwbmk.dwbm
CAST(jxc_yj_xzwz.sl AS int) AS 数量, ISNULL(scdwbmk.dwmc, \'\') AS 所属部门,
CASE jxc_yj_xzwz.syqk WHEN \'0\' THEN \'未使用\' ELSE \'使用\' END AS 使用情况,
SUBSTRING(CONVERT(varchar, jxc_yj_xzwz.rq, 20), 1, 10) AS 制造日期,
jxc_yj_xzwz.zdr AS 制单人, jxc_yj_xzwz.bz AS 备注
FROM jxc_yj_xzwz LEFT OUTER JOIN
scdwbmk ON jxc_yj_xzwz.bmbm = scdwbmk.dwbm
- 上一篇: MYSQL数据库的查询优化技术
- 下一篇: SQL NOTE
-= 资 源 教 程 =-
文 章 搜 索