我最近开始学习oracle和sql。在学习过程中,我遇到了几个问题,我的朋友在一次面试中被问到。
SELECT *
FROM Employees
WHERE NULL IS NULL;
此查询将生成Employees表中的所有行。正如我所理解的,Oracle在列中搜索数据,因此,NULL,这里是否将其视为列名?当我说Oracle在列中搜索数据时,是否正确?为什么Oracle会给出这个查询中的所有行?在WHERE子句中,条件的左侧不是必须是列名吗?它不应该抛出一个错误吗?
SELECT *
FROM Employees
WHERE NULL = NULL;
不提供选定的行。
嗯,我知
我必须编写一个对和Oracle有效的SELECT语句。我必须使用旧的客户数据库,所以我不能改变数据库设计中的任何东西.
问题是该表有一个可空列“project”,它是一个varchar,在某些情况下是由空字符串填充的-- oracle将该字符串转换为NULL。那么,如何选择所有具有非空“项目”的列?
WHERE project IS NOT NULL works for oracle
WHERE project <> '' works for MS
WHERE project IS
我想从SQL-Server 2008访问Oracle 11g数据库中的数据
我设置了一个链接服务器,当我执行
select * from [Link_server_name]..Oracle_schema.Oracle_table
Oracle_table包含Number和varchar2列,所有这些列都是例外的。
但是,当Oracle_table包含一个CLOB列时,我得到以下错误:
DB-Anbieter 'MSDAORA‘für den Verbindungsserver 'L_V407SR8T’帽子模Meldung‘不明错误’zurückgeben。
Der OLE D
我正在尝试将Ubuntu服务器上的Java更新为Java 8,但我收到了错误消息,Java不会更新。
error message: Errors where encountered while processing E: Sub-process /usr/bin/dpkg returned an error code (1)
我用:
sudo add-apt-repository ppa:webupd8team/java
然后:
sudo apt update
犯了错误:
Failed to fetch ......binary-amd64/Packages 404 not found
Fai
我试图安装filezilla,但是缺少这个依赖项(libgnutls30 (>= 3.5.3))。在尝试从源代码安装依赖项时,我没有成功。有人能给我建议一下怎么修吗?在安装依赖项时,我能够配置它,使它,但make没有通过。
The following packages have unmet dependencies:
filezilla : Depends: libgnutls30 (>= 3.5.3) but 3.4.10-4ubuntu1.4 is to be installed
E: Unable to correct problems, you have held bro
在sql developer中,如果我们输入了错误的查询,例如delete from notable
它将向我们显示确切行号和列
Error starting at line : 1 in command -
delete from notable
Error at Command Line : 1 Column : 13
Error report -
SQL Error: ORA-00942: table or view does not exist
00942. 00000 - "table or view does not exist"
*Cause:
*Act
是否可以在Oracle中设置硬编码或计算列的数据类型。
例如::
SELECT AccountID FROM Account
当我读完返回给.Net的记录时,我可以使用一个整数来获取accountID。
_accountID = dr.GetInteger("accountID")
但是,假设我有一个UNION查询,例如:
SELECT AccountID FROM Account
UNION
SELECT 0 as AccountID FROM Account
我得到一个错误:"Specified cast is not valid.",因为硬编码的0列只能使
我有一个列field_name和列,另一个名称是data,如果列名是Oracle,那么数据可以为Null,我不希望在查询中返回它。
我试过了,但不起作用
AND field_name = Case When field_name= 'Oracle' And Data IS Null
field_name <> 'Oracle'
Else field_name
End
W: Failed to fetch http: //ppa.launchpad.net/picaso/octave/ubuntu/dists/trusty/main/binary-amd64/Packages 404 Not Found
W: Failed to fetch http: //ppa.launchpad.net/picaso/octave/ubuntu/dists/trusty/main/binary-i386/Packages 404 Not Found
W: Failed to fetch http: //ppa.launchpad.net/kilian/f.l
这是从表中读取数据然后插入表中的正确方法吗?
我试图读取最大值或rec_id来创建seq列+1,以便将我的数据记录插入到同一个表中。
//Opening the connection with Oracle Database
OracleConnection conn = new OracleConnection(oradb);
conn.Open();
//Create the oracle statment and insert data into oracle database
我有一个表,有3列a,b和c。我想知道如何用每行中其他两列的连接来更新第三列的值。
before update
A B c
-------------
1 4
2 5
3 6
after update
A B c
-------------
1 4 1_4
2 5 2_5
3 6 3_6
我如何在oracle中做到这一点?
每当我想要更新时,都会出现以下错误:
W:Failed to fetch http://ppa.launchpad.net/sun-java-community-team/sun-java6/ubuntu/dists/precise/main/source/Sources 404 Not Found
, W:Failed to fetch http://ppa.launchpad.net/sun-java-community-team/sun-java6/ubuntu/dists/precise/main/binary-amd64/Packages 404 Not Found
我想写postgres alter以在现有表中添加一列我尝试过这个脚本,它在ms sql server和oracle中也运行良好,但是在postgres sql中出现了错误。
错误:键入"AS“不存在第1行: alter添加unique_colum SET (当.
ALTER TABLE employee add unique_colum AS (case when flag = 'n' then ids else name end);
标志和ids是现有的列,我想从任何现有表中再添加一个名为的列和新列的值。