Hello I am making union between 2 databases, they are with same structure table:
use App\map1_weather;
use App\map2_weather;
$weather2 = map2_weather::whereBetween('recordtime', $dateScope)
->selectRaw('recordtime,tempout as temp_map2_weather,hitemp');
$weather = map1_weather::whereBetween('recordtime', $dateScope)
->selectRaw('recordtime,tempout,hitemp')
->orderBy('recordtime', 'ASC')
->union($weather2)
->get();
The error that I have is:
SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "map2_weather" does not exist LINE 1
Is it the right aproach? The goal is to display 2 columns "teomput" in one table from different DBs