4
Good staff,
I would like to know what approach they would take to make a union only if the above query of the union returns values. Consider that the tables are compatible EX:
SELECT * FROM Tabela1
UNION
SELECT * FROM Tabela2
/*Esta query so deve ser executada apenas se a query acima, select * from Tabela1, tiver devolvido algum valor*/
Regards, Leandro
As far as I know you can’t.
– Ricardo
@Ricardo Directly I think there really is nothing like it. But there will be some way to "provoke" this behavior?
– Leandro Rodrigues
It worked the query below?
– Marco Souza
@Dotnet I’m sorry but I haven’t been able to test it yet. I am without access to the database. However I have seen the proposal and I have understood your thinking. However I have a question. The table data type exists in mysql?
– Leandro Rodrigues
If you refer to the creation "declare @Tabela2 table", not exactly this way.
– Marco Souza
The table type exists in any database, now the temporary table creation varies in some databases, the way I used is for SQLSERVER, but select itself works in mysql without problem.
– Marco Souza