With SQL Server, I can send
SELECT * FROM FOO
SELECT * FROM BAR
to the server and get back the results of both, all in one trip.
Can I do that with mySQL also?
With SQL Server, I can send
SELECT * FROM FOO
SELECT * FROM BAR
to the server and get back the results of both, all in one trip.
Can I do that with mySQL also?
As long as the queries have the same number of columns you can do a UNION on the two queries, e.g.
SELECT * FROM foo
UNION
SELECT * FROM bar
I can only speak about the mysqli-extension for PHP, but I guess the same will be possible with most mysql-libraries. In PHP, you can send multiple queries, like
SELECT * FROM foo; SELECT * FROM bar;
with mysqli_multi_query()
and iterate through the result-sets with mysqli_next_result()
.