1) [LEFT | RIGHT] SEMI JOIN and [LEFT | RIGHT] ANTI JOIN
These would allow me to write something like
-- return customers who have placed at least one order
SELECT c.*
FROM Customers c
LEFT SEMI JOIN o ON o.CustomerId = c.Id
-- return customers who have NOT placed any order
SELECT c.*
FROM Customers c
LEFT ANTI JOIN o ON o.CustomerId = c.Id
This would have exactly the same result as
SELECT c.*
FROM Customers c
WHERE c.Id IN(SELECT CustomerId FROM Orders)
and
SELECT c.*
FROM Customers c
WHERE c.Id NOT IN(SELECT CustomerId FROM Orders)
, respectively. However the IN (or the pretty much equivalent EXISTS) syntax is much messier than my proposed syntax, especially in more complicated cases.
Of course, the semi/anti-joined table can not be referenced so this would be ILLEGAL:
-- Error, can't reference semi joined table.
SELECT c.*, o.OrderNumber
FROM Customers c
LEFT SEMI JOIN o ON o.CustomerId = c.Id
2) It woud be nice to have a good solution to the
WHERE Column IN('a', 'b', 'c')
problem when you don't know the number of values to search for. Perhaps it could be possible to allow
WHERE Column IN(ARRAY @array)
and the calling code would bind @array to an array.
Edit: I just thought of one more
3) Some kind of extensibility to the constraint system, which allows coding of constraints between tables which work perfectly in concurrent environments and which lets me manually do any locking and validation to ensure that the constraint is always satisfied. Triggers can be used currently, but they are very hard to get right considering concurrency.