thinkphp-where-An expression query

Source: Internet
Author: User

Grammar

Where (' field name ', ' expression ', ' query condition ');

List of expressions

An expression meaning
EQ, = equals (=)
NEQ, <> Not equal to (<>)
GT, > Greater than (>)
EGT, >= Greater than or equal to (>=)
LT, < Less Than (<)
ELT, <= Less than or equal (<=)
Like Fuzzy query
[NOT] Between (not) Interval query
[NOT] Inch (not) in query
[NOT] Null Whether the query field is (not) null
[NOT] EXISTS exists query
BX7 expression queries, supporting SQL syntax
> Time Time comparison
< time Time comparison
Between time Time comparison
Notbetween time Time comparison

Example

Where (' id ', ' eq ', ' n '); where (' id ', ' = ', +); where (' id ', 100);
Where (' id ', ' neq ', ' n '); where (' id ', ' <> ', 100);
Where (' id ', ' GT ', ' n '); where (' id ', ' > ', 100);
Where (' id ', ' egt ', ' n '); where (' id ', ' >= ', 100);
Where (' id ', ' lt ', ' n '); where (' id ', ' < ', 100);
Where (' id ', ' elt ', +); where (' id ', ' <= ', 100);
Where (' name ', ' like ', ' thinkphp% '); where (' name ', ' like ', ['%think ', ' php% '], ' OR ');
Where (' id ', ' between ', ' 1,8 '); where (' id ', ' between ', [1,8]);
Where (' id ', ' not ', ' 1,5,8 '); where (' id ', ' not ', [1,5,8]);
Where (' name ', null), where (' title ', ' null '); where (' name ', ' not null '); where (' title ', ' = ', ' null '); where (' name ', ' = ', ' Not null ');
Where (' id ', ' in ', ' 1,3,8 '); where (' id ', ' exp ', ' in (1,3,8) ');


thinkphp-where-An expression query

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.