Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
用于选择偶数列的oracle sql查询_Sql_Database_Oracle_Select_Where Clause - Fatal编程技术网

用于选择偶数列的oracle sql查询

用于选择偶数列的oracle sql查询,sql,database,oracle,select,where-clause,Sql,Database,Oracle,Select,Where Clause,在oraclesql中,当我试图获取下面的输出时,它抛出了错误 select city,id from station where id % 2 = 0; 错误: ORA-00911: invalid character 00911. 00000 - "invalid character" *Cause: identifiers may not start with any ASCII character other than letters and number

在oraclesql中,当我试图获取下面的输出时,它抛出了错误

select city,id from station where id % 2 = 0;
错误:

ORA-00911: invalid character
00911. 00000 -  "invalid character"
*Cause:    identifiers may not start with any ASCII character other than
           letters and numbers.  $#_ are also allowed after the first
           character.  Identifiers enclosed by doublequotes may contain
           any character other than a doublequote.  Alternative quotes
           (q'#...#') cannot use spaces, tabs, or carriage returns as
           delimiters.  For all other contexts, consult the SQL Language
           Reference Manual.

Oracle不支持模运算的
%
运算符。您需要使用:


太好了,成功了,非常感谢你,我还有一个关于出生日期的问题,请简短地发帖你好,你能帮我回答下面的问题吗?我有一张学生表,结构如下:描述学生;姓名类型SNO编号(2)SNAME VARCHAR2(15)DOB日期年龄编号(2)TNO编号(2)在DOB列中插入数据时,将错误插入学生(SNO、SNAME、DOB、年龄、TNO)值('42','IRONMAN','01-01-1991','29','1');错误:错误报告:SQL错误:ORA-01843:不是有效的月份01843。00000-“非有效月份”PLZHELP@Jack:评论并不是为了问新问题。。。我建议问一个新问题。此外,如果此答案正确回答了您的原始问题,请单击绿色复选标记。。。谢谢。@Jack看起来你需要提供DOB的
日期,而不是
'01-01-1991'
。看见
select city,id from station where mod(id, 2) = 0;