Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Query
    • Overview
    • Selecting data from all columns
    • Selecting data from specific columns
    • Sorting and filtering
    • Aggregating data
    • Additional selection criteria
    • Working with JSON
    • Running a streaming data query
  • Access management
  • Pricing policy
  • Integration
  • Audit Trails events
  • FAQ
  1. Working with YQL
  2. Sorting and filtering

Sorting and filtering data

Written by
Yandex Cloud
Improved by
Max Z.
Updated at March 6, 2025

When selecting data, you can specify filter expressions that will limit the result. You can also set the order of values returned.

For example:

  • Find 10 rides with the largest tips.
  • Exclude rides with a fare of over $1,000,000.
SELECT
    *
FROM
    `tutorial-analytics`
WHERE
    tip_amount > 0          -- List of conditions for generation of the result.
    AND                     -- `AND` operator for complex conditions.
    total_amount < 1000000
ORDER BY tip_amount DESC    -- Sort the results by the `tip_amount` field in descending order.
LIMIT 10                    -- Use only 10 entries.

View the example in the right-hand section and click Run.
Query results are available in the Result tab as a table or schema.

See alsoSee also

  • SELECT operator
  • WHERE operator
  • ORDER BY operator

Was the article helpful?

Previous
Selecting data from specific columns
Next
Aggregating data
© 2025 Direct Cursus Technology L.L.C.