MySQL 查询字段内出现的情况
我在名为 b_orders 的表中有一个名为 Invoice_notes 的字段。在此字段中,“信用卡被拒绝”字样将出现多次,具体取决于该卡被拒绝的次数。我正在尝试编写一个查询来仅选择短语“Credit Card Declined”出现次数少于 4 次的记录?
像这样的东西: SELECT * FROM b_orders 其中invoice_notes 具有“信用卡被拒绝”< 4 "
如有任何帮助,我们将不胜感激。 谢谢
I have a field called invoice_notes in a table called b_orders. In this field the words "Credit Card Declined" will show up several times depending on how many times the card has been declined. I am trying to write a query to select only the records where the phrase "Credit Card Declined" appears less than 4 times?
Something like this:
SELECT * FROM b_orders where invoice_notes has "Credit Card Declined" < 4 "
Any help is appreciated.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这听起来像答案: http://pisceansheart.wordpress.com/2008/04/15/count-occurrence-of-character-in-a-string-using-mysql/
引用:
对于您的具体示例:
This sounds like the answer: http://pisceansheart.wordpress.com/2008/04/15/count-occurrence-of-character-in-a-string-using-mysql/
Quote:
For your specific example:
怎么样:
How about something like: