首页 \ 问答 \ 如何在SQL中搜索包含冒号的字符串?(How can i search for a string in SQL which contains a colon?)

如何在SQL中搜索包含冒号的字符串?(How can i search for a string in SQL which contains a colon?)

有没有办法在SQL中搜索包含冒号的字符串?

例:

我在数据库中有像2009-09-17 05:00:00.0002011-11-10 06:00:00.000的值。 但是我想要所有具有05:的值。

我尝试了以下SQL,但它给了我一个空白的结果:

SELECT cast(narrative_date as datetime)
FROM P_MATTER_NARRATIVE
WHERE cast(narrative_date as datetime)
LIKE '%05:%';

谢谢Rajan


Is there a way I can search for a string in SQL which contains a colon?

Example:

I have values like 2009-09-17 05:00:00.000 and 2011-11-10 06:00:00.000 in the database. But I want all the values which have 05: in them.

I tried the following SQL, but it gives me a blank result:

SELECT cast(narrative_date as datetime)
FROM P_MATTER_NARRATIVE
WHERE cast(narrative_date as datetime)
LIKE '%05:%';

Thanks Rajan


原文:https://stackoverflow.com/questions/31238938
更新时间:2023-07-03 06:07

最满意答案

显然,我上次尝试这个时忘了包含always关键字。

<div style="page-break-after:always"></div>

毕竟这确实最终起作用了。 只需要确保div始终关闭,否则它不会被切断。 或者,也许更安全的方法是使用:

<div style="page-break-before:always"></div>

这样,如果你不小心忘记关闭它,我相信它仍然会削减页面。


Apparently, last time I tried this I forgot to include the always keyword.

<div style="page-break-after:always"></div>

That did end up working after all though. Just have to make sure that div is always closed or else it won't cut. Alternatively, perhaps a safer approach is to use:

<div style="page-break-before:always"></div>

That way if you accidentally forget to close it, I believe it'll still cut the page.

相关问答

更多
  • 我使用的是版本wkhtmltopdf 0.12.0 对我来说,分页符只适用于--print-media-type。 没有它,图像的分页保护可以正常工作,但不能在分页后或之前使用。 我必须为打印介质制作一个特殊的css文件才能使其正常工作。 将纸张尺寸设置为“A3”或使用“溢出:可见”没有任何区别。 另请参阅WKHTMLTOPDF并在Rails上使用pdfkit忽略表分页符 The solution i found was to set the page size to A3, which make all ...
  • JavaScript不允许您覆盖客户端浏览器的默认页面设置,因为浏览器通过沙箱脚本来保护硬件和操作系统,以避免任何恶意。 但是您的问题与此问题类似,也许您可以使用Google Cloud Print设置您的打印机,然后使用它的API来执行此操作。 best way is using js print setup extension on firefox. But the extension dos not support over firefox 56. So you have to donwload ma ...
  • 只需按照文档并发送打开抽屉所需的代码序列。 如果您没有打印机的文档,可以在此处查找序列。 我相信在您的打印机上,只需发送ASCII铃声字符(十进制7)就会打开抽屉。 Just follow the documentation and send the sequence of codes needed to open the drawer. You can look up sequences here if you don't have the documentation for your printer. ...
  • 我准备被证明是错误的,但我不认为这是微不足道的。 打印后台处理程序没有关于页面开始和结束的假想的概念。 每个页面的位置都依赖于语言,并且打印后台处理程序很难期望解析流以查找每个页面的开始和结束,但一件事情会非常缓慢。 另一种方法是让打印处理器记录每个页面的开始和结束以及此时假脱机文件的偏移量,然后将这些信息分别传递给假脱机程序。 但也有问题。 “RAW打印”功能允许打印应用程序将“stuff”直接插入打印流中,完全绕过打印处理器。 例如,在打印到PostScript打印机时,这对于页面布局应用程序很常见,特 ...
  • 您的打印机不允许设置这些属性,或者您超出了允许的最大值。 从Visual Basic参考 如果为不允许设置这些属性的打印机驱动程序设置“高度”和“宽度”属性,则不会发生错误,并且纸张尺寸保持原样。 如果为仅允许指定特定值的打印机驱动程序设置“高度”和“宽度”,则不会发生错误,并且该属性将设置为驱动程序允许的任何值。 例如,您可以将Height设置为150,然后驱动程序将其设置为144。 我不知道为什么当您将Papersize属性设置为256时出现错误。它适用于我。 此外, 该文档指出,“设置打印机的高度或宽 ...
  • 我终于找到了解决方案。 诀窍是使用Microsoft提供的类和热敏打印机提供程序的ESC / POS语言规范将原始数据直接发送到热敏打印机,以格式化数据。 最好的方法是向热敏打印机提供商询问示例代码。 谢谢大家。 I finally found the solution. The trick is to send raw data directly to the thermal printer by using a class provided by Microsoft and the ESC/POS la ...
  • 问题是您正在创建新页面,但未将其添加到PrinterJob 您添加下面的评论。 // Specify the painter painter = new Printing(printerData); pj.setPrintable(painter); PageFormat pf0 = pj.defaultPage(); Paper p = pf0.getPaper(); p.setImageableArea(0, 0, pf0.getWidth(), pf0.getHeight()); pf0.setPap ...
  • 显然,我上次尝试这个时忘了包含always关键字。
    毕竟这确实最终起作用了。 只需要确保div始终关闭,否则它不会被切断。 或者,也许更安全的方法是使用:
    这样,如果你不小心忘记关闭它,我相信它仍然会削减页面。 Apparently, last time I tried this I forgot to include the ...
  • ESC + | Epson打印机上的+ N在将字体设置为大,粗等后将字体重置为正常。但是,这会导致Star口吃到剧烈摇晃的程度。 我能够从我的代码中删除该转义序列,并且不会影响Epson打印机的输出,所以现在Star减少了。 注意,它不会停止口吃,它打印50行,翻转2或3行,并重复。 如果您能够在修复之前和之后看到打印机打印,那真的是一个巨大的改进。 ESC + | + N on an Epson printer resets the font to normal after setting it to b ...
  • 确保元素具有page-break-after: always; 是一个块元素。 另一个选择器可能会将其更改为内联块或其他可防止应用中断的内容。 还要确保元素不在float ed元素中。 谢谢RoadBump。 Make sure the element with page-break-after: always; is a block element. Another selector might be changing it to inline-block or something else which ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。