【问题标题】:How to select tables with specific degree from user_tables如何从 user_tables 中选择具有特定度数的表
【发布时间】:2020-11-24 15:12:43
【问题描述】:
select * from user_tables where degree = '1';

这是给 null 但是当我们这样做时

select * from user_tables 

那么它确实显示了 1 度的表格

【问题讨论】:

  • degree的数据类型是什么?如果它是 VARCHAR2 它可能包含您在输出中看不到的空格,例如'1 '
  • 我错过了,通常我会修剪角色,谢谢

标签: sql oracle oracle11g oracle-sqldeveloper


【解决方案1】:

几年前我也遇到过类似的问题,Degree 列是 varchar2(10),因此您应该使用以下查询

SELECT * FROM USER_TABLES WHERE TRIM(DEGREE) = '6';

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-09-15
    • 1970-01-01
    • 2022-11-01
    • 1970-01-01
    • 2012-12-05
    • 1970-01-01
    • 2019-01-02
    • 2021-02-17
    相关资源
    最近更新 更多