Oracle INNER JOIN不起作用,但CARTESIAN联接有效

时间:2019-05-28 05:49:12

标签: c# oracle inner-join

我收到一个非常奇怪的错误。 如果我使用INNER JOIN编写查询,如下所示:

 String query = @"SELECT     *
                  FROM       BKING CCVB
                  INNER JOIN SEM S ON CCVB.BKING_REQ_DTM BETWEEN S.ST_D AND S.END_D";
 OracleCommand dbCommand = new OracleCommand(query, Connection);
 OracleDataAdapter adapter = new OracleDataAdapter(dbCommand);
 OracleCommandBuilder builder = new OracleCommandBuilder(adapter);
 DataTable dt = new DataTable();
 adapter.Fill(dt);
 return dt;

查询失败,并显示以下错误消息:

  

{Oracle.ManagedDataAccess.Client.OracleException(0x80004005):ORA-00942:表或视图不存在

但是当我更改为笛卡尔联接时,就可以了:

 String query = @"SELECT     *
                  FROM       BKING CCVB, SEM S 
                  WHERE      CCVB.BKING_REQ_DTM BETWEEN S.ST_D AND S.END_D";
 OracleCommand dbCommand = new OracleCommand(query, Connection);
 OracleDataAdapter adapter = new OracleDataAdapter(dbCommand);
 OracleCommandBuilder builder = new OracleCommandBuilder(adapter);
 DataTable dt = new DataTable();
 adapter.Fill(dt);
 return dt;

它失败的任何特殊原因?以及如何解决?

0 个答案:

没有答案