Hi,
I've run into this a few times.
I would like to have the ability to do a simple query with an IN clause, without having to rely on advanced queries.
It should accept a list of <myTable> Identifier.
Today we do ( from an aggregate perspective):
SELECT * FROM {TASKS} WHERE id = 1 or id = 2 or id = 3
But it would be really awesome if we could do
SELECT * FROM {Tasks} WHERE id in (1,2,3)
This allows us to do some pretty cool stuff with Lists setc ( eg you can now shim some of the more advanced sql functionality without writing advanced queries).
An example would be:
myList = SELECT id from People WHERE OrganisationId = 2
SELECT * FROM {Tasks} WHERE personId = myList
Which would be 2 actions, and somewhat faster/cleaner than the current way
I've run into this a few times.
I would like to have the ability to do a simple query with an IN clause, without having to rely on advanced queries.
It should accept a list of <myTable> Identifier.
Today we do ( from an aggregate perspective):
SELECT * FROM {TASKS} WHERE id = 1 or id = 2 or id = 3
But it would be really awesome if we could do
SELECT * FROM {Tasks} WHERE id in (1,2,3)
This allows us to do some pretty cool stuff with Lists setc ( eg you can now shim some of the more advanced sql functionality without writing advanced queries).
An example would be:
myList = SELECT id from People WHERE OrganisationId = 2
SELECT * FROM {Tasks} WHERE personId = myList
Which would be 2 actions, and somewhat faster/cleaner than the current way
- Writing an advanced query ( frowned up by my companies' best practices guide - and I've also found advanced queries tend to be annoying to manage )
- Looping through myList and putting the outputs into another list, which is then passed around (this also has a few nasties - lots of DB hits (albeit small ones), and refreshing this with paging is a pain