倒向类语句

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了倒向类语句相关的知识,希望对你有一定的参考价值。

  1. Sometimes you need TO think backwards.
  2.  
  3. Here was the problem. I needed TO MATCH up SOME IP address ranges TO the company that owns them. Looking FOR a simple solution TO the problem I came up WITH storing the IP address block patterns IN the DATABASE AS follows:
  4.  
  5. ip_pattern
  6. ----------------
  7. 127.%.%.%
  8. 192.168.%.%
  9. 10.%.%.%
  10.  
  11. Any idea why I choose % AS the wildcard?
  12.  
  13. That's right - it's the wildcard operator IN SQL FOR the LIKE statement.
  14.  
  15. So now WHEN I have have an IP address 192.168.1.1, I can do what I LIKE TO CALL a backwards LIKE query:
  16.  
  17. SELECT company, ip_pattern
  18. FROM company_blocks
  19. WHERE '192.168.1.1' LIKE ip_pattern
  20.  
  21. This works ON SQL Server AND mysql, AND I would think it should WORK fine ON any DATABASE server.

以上是关于倒向类语句的主要内容,如果未能解决你的问题,请参考以下文章

为啥 Objective-C 中的头文件顶部有 import 和 class 语句?

为什么我这个 Java 死忠倒向了 Node.js?

快速向类函数添加回调

向类添加额外的向量

类成员的前向类声明

如何在 C# 运行时向类添加属性?