File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
MyApp/_pages/ormlite/apis Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -196,6 +196,30 @@ q = db.From<Track>()
196
196
var top2CountOfAByYear = db .Dictionary <string , int >(q );
197
197
```
198
198
199
+ ## Sql.In
200
+
201
+ ### Nested Typed Sub Select Sql Expressions
202
+
203
+ The ` Sql.In() ` API supports nesting and combining of multiple Typed SQL Expressions together
204
+ in a single SQL Query, e.g:
205
+
206
+ ``` csharp
207
+ var usaCustomerIds = db .From <Customer >(c => c .Country == " USA" ).Select (c => c .Id );
208
+ var usaCustomerOrders = db .Select (db .From <Order >()
209
+ .Where (x => Sql .In (x .CustomerId , usaCustomerIds )));
210
+ ```
211
+
212
+ ### SQL IN with collections
213
+
214
+ By using ` Sql.In ` from within a ` SqlExpression<T> ` , multiple values can be checked for a match in your query.
215
+
216
+ ``` csharp
217
+ db .Select <Author >(x => Sql .In (x .City , " London" , " Madrid" , " Berlin" ));
218
+
219
+ var cities = new [] { " London" , " Madrid" , " Berlin" };
220
+ db .Select <Author >(x => Sql .In (x .City , cities ));
221
+ ```
222
+
199
223
## SqlExpression with JOIN examples
200
224
201
225
Just like SQL, SqlExpression supports multiple JOIN's that can leverage OrmLite's Reference Conventions for Simple, Terse and Intuitive Table JOIN's:
You can’t perform that action at this time.
0 commit comments