Okay, I just used a single type of query but you'll get the idea, look at this code:
Code:
EmployeesQuery sub = new EmployeesQuery();
sub.Select(sub.EmployeeID);
sub.Where(sub.EmployeeID.In(1, 8, 12, 15));
EmployeesQuery main = new EmployeesQuery();
main.Where(main.EmployeeID.NotIn(sub));
EmployeesCollection coll = new EmployeesCollection();
coll.Load(main);
This generates this SQL
Code:
SELECT * FROM [Employees]
WHERE [EmployeeID] NOT IN
(
SELECT [EmployeeID] AS 'EmployeeID' FROM [Employees]
WHERE [EmployeeID] IN (1,8,12,15)
)
This POST is awesome and shows how you can write subqueries in some very cool and highly readable ways
EntitySpaces |
Twitter |
BLOG | Please honor our Software License