gpt4 book ai didi

sql - `x`在这条Oracle SQL语句: `select * from dual where x=1 or 1=1` 中指的是什么

转载 作者:行者123 更新时间:2023-12-01 03:30:38 27 4
gpt4 key购买 nike

我偶然发现在Oracle SQL中可以发出以下语句:select * from dual where x=1 or 1=1 .

  • dual中的栏目被命名 dummy而不是 x .
  • 如果我从任何其他表中选择,它仍然有效,返回所有行。
  • select * from dual where y=1 or 1=1也有效。
  • select * from dual where z=1 or 1=1不起作用,给 ORA-00904: z: invalid identifier .
  • select * from dual where x=1不起作用,给 ORA-06553: PLS-306: wrong number or types of arguments in call to 'OGC_X' .

  • 做什么 xy引用?

    最佳答案

    这似乎是因为在某些 Oracle DB 版本上存在名为 X 和 Y 的同义词:

    select owner, synonym_name, table_owner, table_name from dba_synonyms where synonym_name in ('X', 'Y');

    OWNER SYNONYM_NAME TABLE_OWNER TABLE_NAME
    ------------------------------ ------------------------------ ------------------------------ ----------
    PUBLIC X MDSYS OGC_X
    PUBLIC Y MDSYS OGC_Y

    关于sql - `x`在这条Oracle SQL语句: `select * from dual where x=1 or 1=1` 中指的是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38091046/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com