共用方式為


< (Less Than) (Entity SQL)

Compares two expressions to determine whether the left expression has a value less than the right expression.

expression < expression

Arguments

  • expression
    Any valid expression. Both expressions must have implicitly convertible data types.

Result Types

true if the left expression has a value less than the right expression; otherwise, false.

Example

The following Entity SQL query uses < comparison operator to compare two expressions to determine whether the left expression has a value less than the right expression. The query is based on the AdventureWorks Sales Model. To compile and run this query, follow these steps:

  1. Follow the procedure in How to: Execute a Query that Returns StructuralType Results (EntityClient).

  2. Pass the following query as an argument to the ExecuteStructuralTypeQuery method:

SELECT VALUE product FROM AdventureWorksEntities.Product 
    AS product where product.ListPrice < 125

The output is shown below:

ProductID: 1
Name: Adjustable Race
ProductNumber: AR-5381
MakeFlag: False
ProductID: 2
Name: Bearing Ball
ProductNumber: BA-8327
MakeFlag: False
ProductID: 3
Name: BB Ball Bearing
ProductNumber: BE-2349
MakeFlag: True
ProductID: 4
Name: Headset Ball Bearings
ProductNumber: BE-2908
MakeFlag: False
ProductID: 316
Name: Blade
ProductNumber: BL-2036
MakeFlag: True
...

See Also

Concepts

Entity SQL Reference

Other Resources

Comparison Operators