我有这个 oracle 表:
CREATE TABLE USERS(
USERID INTEGER NOT NULL,
GROUPID INTEGER,
SPECIALNUMBER VARCHAR2(60 ),
USERNAME VARCHAR2(50 ),
PASSWD VARCHAR2(50 ),
DATETOCHANGEPASSWD DATE,
ADDRESS VARCHAR2(60 ),
STATEREGION VARCHAR2(50 ),
COUNTRY VARCHAR2(50 ),
USERSTATUS VARCHAR2(30 ),
TELEPHONE VARCHAR2(50 ),
DATEUSERADDED DATE,
USEREXPIREDATE DATE,
DATEUSERLOCKED CHAR(20 ),
CITY VARCHAR2(50 ),
EMAIL VARCHAR2(50 ),
DESCRIPTION CLOB
)
我使用这个 SQL 查询来获取行:
SqlStatementSmall = "SELECT c.*"
+ " FROM (SELECT b.*, rownum rn"
+ " FROM (SELECT a.*"
+ " FROM USERS a"
+ " ORDER BY %s %s) b"
+ " WHERE rownum <= ?) c"
+ " WHERE rn > ?";
如何修改 SQL 查询以仅选择状态为“活动”的行?
最好的祝愿