如何在 Oracle Sql Developer 中过滤列

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24559009/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 02:09:57  来源:igfitidea点击:

How to filter a column in Oracle Sql Developer

sqloracle-sqldeveloper

提问by joshpt

Let's say I have some timestamp fields in a column that look like this "02-JUL-14 10.36.07.713000000 PM".

假设我在列中有一些时间戳字段,类似于“02-JUL-14 10.36.07.713000000 PM”。

Is there a way for me to left-click the column in that table and do a search that contains "JUL" so that I only have rows show up that contain "JUL"?

有没有办法让我左键单击该表中的列并执行包含“JUL”的搜索,以便只显示包含“JUL”的行?

I have read articles of people saying to include % and ' characters around the word, and using the LIKE ' ' syntax, but nothing has worked out for me.

我读过一些人说在单词周围包含 % 和 ' 字符,并使用 LIKE ' ' 语法的文章,但对我来说没有任何效果。

So in the picture below, I wish I could just type in "JUL", and only rows with the TIME_OF_ENTRY column that contain the letters "JUL" will appear.

所以在下面的图片中,我希望我可以只输入“JUL”,并且只有 TIME_OF_ENTRY 列包含字母“JUL”的行才会出现。

I do realize that typing in the filter window below is an EXACT search, but I want to know if there is a way to do a "contains" type of search.

我确实意识到在下面的过滤器窗口中输入是精确搜索,但我想知道是否有办法进行“包含”类型的搜索。

enter image description here

在此处输入图片说明

回答by joshpt

Paste

粘贴

like '%JUL%'

in the filter field, and whatever values in that column which contain "JUL" will show up.

在过滤器字段中,该列中包含“JUL”的任何值都会显示出来。

The http://www.thatjeffsmith.com/archive/2011/11/sql-developer-quick-tip-filtering-your-data-grids/link from @OldProgrammer contained the solution that I found. There may be more helpful things in that link for more advanced filtering, perhaps.

来自@OldProgrammer的 http://www.thatjeffsmith.com/archive/2011/11/sql-developer-quick-tip-filtering-your-data-grids/链接包含我找到的解决方案。也许该链接中可能有更多有用的内容用于更高级的过滤。

回答by Erich Kitzmueller

Type

类型

to_char(TIME_OF_ENTRY) like '%JUL%'

in the filter field above.

在上面的过滤器字段中。

回答by scvblwxq

The statement to_char(fieldname) like `%likevalue%`worked for me using NetBean 8.0.2. I pasted it into the main filter field at the top of the page with an appropriate fieldname and likevalueand made sure that the individual filter fields were cleared. I removed the percent signs when I didn't need them.

该语句to_char(fieldname) like `%likevalue%`使用 NetBean 8.0.2 对我有用。我将它粘贴到页面顶部的主过滤器字段中,并使用适当的字段名,likevalue并确保清除了各个过滤器字段。当我不需要它们时,我删除了百分号。