I would like to create something like a query that gets called everytime I write an alias. So something like :
myalias = select codes from codetables where validity=current_date ;
then use it like :
select * from mainregistry where code in (myalias) ;
the "myalias" should be available everywhere everytime, so there should be a way of having it "default" in all my dbs.