# AQL Operators > How AQL operators work, from the pipe operator to logical comparisons across text, numbers, datetimes, and booleans, with a syntax example for each one. A key component of AQL's query syntax involves the utilization of operators to generate more precise metrics. ## Pipe The pipe operator `|` chains expressions left-to-right by passing the left side as the first positional argument to the function on the right. ```aml expr | fn(args) // equivalent to: fn(expr, args) ``` Example: ```aml orders | filter(orders.country = 'Singapore') | sum(orders.total_value) ``` For the conceptual treatment (when pipes shine, the table-vs-scalar mental model, debugging tips), see [The pipe operator](/as-code/aql/learn/pipe). ## Logical Operator These operators serve to compare values and yield a [truefalse](/reference/aql/type-truefalse) result. ### Text | Operator | Example | Description | | --- | --- | --- | | `==` `is`| `products.name == 'Dandelion'` `products.name is 'Dandelion'` | Equal to | | `!=` `is not`| `products.name != 'Rock'` `products.name is not 'Rock'`| Not equal to | | `like` | `products.name like '%Dan'` | Match the pattern specified | | `not like` | `products.name not like '%Dan'` | Not match the pattern specified | | `ilike` | `products.name ilike '%dan'` | Match the pattern specified, case insensitive | | `not ilike` | `products.name not ilike '%dan'` | Not match the pattern specified, case insensitive | | `is null` | `products.name is null` | Include if the value is null | | `is not null` | `products.name is not null` | Include if the value is not null | ### List | Operator | Example | Description | | --- | --- | --- | | `in` | `products.name in ['Dandelion', 'Rock']` | Include if the value is in the list | | `not in` | `products.name not in ['Dandelion', 'Rock']` | Include if the value is not in the list | ### Truefalse | Operator | Example | Description | | --- | --- | --- | `is` | `orders.is_paid is true` | Equal to | | `is not` | `orders.is_paid is not true` | Not equal to| | `is null` | `orders.is_paid is null` | Include if null | | `is not null` | `orders.is_paid is not null` | Include if not null | ### Number | Operator | Example | Description | | --- | --- | --- | | `==` `is`| `order_items.discount == 0.5` `order_items.discount is 0.5`| Equal to| | `!=` `is not`| `order_items.discount != 1` `order_items.discount is not 1`| Not equal to| | `>` | `order_items.discount > 0.5` | Greater than | | `<` | `order_items.discount < 0.5` | Less than | | `is null` | `order_items.discount is null`| Include if null | | `is not null` | `order_items.discount is not null`| Include if not null | ### Datetime Right hand side of datetime operator takes a [datetime scalar type](/reference/aml/date-format) as input and always starts with `@` token. Datetimes can be expressed in a fully supported format as `@YYYY-MM-DD HH:MM:SS`, in shorter variations like `@YYYY-MM`, or a relative datetime (relative to the current real world time) like `@(last 7 days)`. :::tip For more information on datetime, please refer to: - [Datetime Literals](/reference/aql/datetime-literal) - [Natural Time Expression](/docs/datetimes/relative-dates) ::: Operator Example Meaning Description == - orders.created_at == @2022 - orders.created_at == @(last 7 days) - orders.created_at equal to 2022-01-01 00:00:00- orders_created_at equal to the first timestamp of the last 7 days Include data that equal to an absolute timestamp ismatchesmatch - orders.created_at is @2022 - orders.created_at match @(last 7 days) - orders.created_at is in the period of the year 2022- order.created_at is in the period of the last 7 days Include data that are in a time period != orders.created_at != @2022-01 - orders.created_at is not equal to 2022-01-01 00:00:00 Include data that do not equal to an absolute timestamp is not orders.created_at is not @2022-01 - orders.created_at is not in the period of 2022-01 Include data that are not in a time period < orders.created_at < @2022 - orders.created_at is before the year 2022 Include data that are before a specific time period > orders.created_at > @(yesterday) - orders.created_at is after yesterday Include data that are after a specific time period is null orders.created_at is null - orders.created_at is null Include if the value is null is not null orders.created_at is not null - orders.created_at is not null Include if the value is not null