Is there a way to run two (or more) sql queries into the same dataset. The field headings would be the same.
For example, if I want to pull out all students with the firstname of David, and in a separate query wanted to pull out all staff with the firstname of David, could I do it with 2 different queries? - I know in this example I could build a UNION statement, but want to know if it is possible by running two separate queries.
I have tried this, but only get results for Staff.
$sql = "SELECT 'STU' as PersonType, Firstname, Lastname FROM Students WHERE Firstname = 'David'";
$this->src('students')
->query($sql)
->saveTo($root);
$sql = "SELECT 'STAFF' AS PersonType, Firstname, Lastname FROM Staff WHERE Firstname = 'David'";
$root->query($sql)->saveTo($root);
$root->pipe($this->dataStore('results'));