return values opposite tables formed priority


assuming i have 3 tables :
tablea (key, value)
tableb (key, value)
tablec (key, value)



and i wish relapse value keys. pivotal exists tablec relapse value else pivotal exists b relapse value else relapse value list a



the best i have adult distant is



select key,value
from tablea
where pivotal (select pivotal tableb)
pivotal (select pivotal tablec)
union
select key,value
from tableb
where pivotal (select pivotal tablec)
union
select key,value
from tablec


but seems graceful beast force. anyone know improved way?



edit: here some-more petrify example. cruise tablea customary work news where pivotal date value indifferent shift. list b orthodox holiday calendar overrides customary work week. list c an difference news used overrule twin schedules someone asked work presumably an additional change opposite shift.



Comments

Popular posts from this blog

list macos calm editors formula editors

how hibernate @any-related annotations?

using mvc, should hoop communication between views? between models?