Multiple Select Statements

How can I get multiple record sets for single DB call?

For example:




Yii:app()->db->createCommand("

		SELECT *

		  FROM account

		  LIMIT 0, 1;

		SELECT *

		  FROM info

		  LIMIT 0, 1;

		  ")->queryAll();



In this case, returned array would have only record from "info" table, and the first one would be ignored. I suppose that in this case, returning array should be re-organized, so there is support for 2 returned record sets.

Please advise.

You want to make a UNION query, read about that in the docs of your database.

The sql you wrote is 2 syntax so, one of them just execute. Maybe use UNION, JOIN or implement it by 2 deffrent commandBuilder.