1、操作透明表-查询
查询0条数据只做判断
SELECT COUNT(*)
FROM ZHY_XYXX_01
WHERE ZBJ = '202404'.
IF SY-SUBRC = 0.
WRITE '班级存在'.
ELSE.
WRITE '班级不存在'.
ENDIF.
查询一条数据
*查询一条数据
SELECT SINGLE
ZBJ,
ZXH
INTO @GS_ZXYXX
FROM ZHY_XYXX_01
WHERE ZBJ = '202208'.
(使用INTO时,需要配合@否则会报错)
更正后:
*查询一条数据 SELECT SINGLE ZBJ, ZXH INTO @GS_ZXYXX FROM ZHY_XYXX_01 WHERE ZBJ = '20240429'. SELECT COUNT(*) FROM ZHY_XYXX_01 |