Skip to content

Customizing common SQL clauses

Working with EasyQuery, sometimes you need to add to generated SQL some additional clauses, which are common for the whole query (DISTINCT, TOP, etc)

To implement this you need to use Options.SelectDistinct property of a DbQuery object:

query.Options.SelectDistinct = true;

You can add TOP or LIMIT clause into result SQL statement using the following commands:

query.Options.SelectTop = "100";

Or

query.Options.LimitClause = "20";