[<<][sql][>>][..]
Mon Mar 28 12:47:38 EDT 2016

finite functions

Since functional modeling (keys) is such a big deal in databases, why
is there no syntax to turn a table into a function?

E.g.  select  tab1(x) from tab2

Where the function tab1 corresponds to:

x -> select val from tab1 where key=x;


Maybe because it is hard to optimize?  You likely don't want to write
the function such that it does a single sub-select for each value.
Likely you want it as a join, so the query engine can do its magic.  

What would be nice maybe is to have some syntactic sugar to turn
functional references like that into joins...  Or to just learn to
live with the limitation?  It is nice as an abstraction anyway.




[Reply][About]
[<<][sql][>>][..]