I already read this question. But this is on same table. How can I archie that in two or three table like :
if (SELECT ViewCode FROM M_VIEW
WHERE ViewCode=?) //if found return
else (SELECT ViewCode FROM M_Customer
WHERE CustomerCode=?)