简体   繁体   English

如何在Oracle Sql Developer中过滤列

[英]How to filter a column in Oracle Sql Developer

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”,并且只会出现包含字母“JUL”的TIME_OF_ENTRY列的行。

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. 我确实知道在下面的过滤器窗口中键入是一个精确的搜索,但我想知道是否有办法进行“包含”类型的搜索。

在此输入图像描述

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. 来自@OldProgrammer的http://www.thatjeffsmith.com/archive/2011/11/sql-developer-quick-tip-filtering-your-data-grids/链接包含我找到的解决方案。 There may be more helpful things in that link for more advanced filtering, perhaps. 可能在该链接中可能有更多有用的东西用于更高级的过滤。

Type 类型

to_char(TIME_OF_ENTRY) like '%JUL%'

in the filter field above. 在上面的过滤器字段中。

The statement to_char(fieldname) like `%likevalue%` worked for me using NetBean 8.0.2. 使用NetBean 8.0.2的语句to_char(fieldname) like `%likevalue%` I pasted it into the main filter field at the top of the page with an appropriate fieldname and likevalue and made sure that the individual filter fields were cleared. 我将其粘贴到页面顶部的主过滤器字段中,并使用相应的fieldname和likevalue ,并确保清除了各个过滤器字段。 I removed the percent signs when I didn't need them. 当我不需要它时,我删除了百分号。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM