maria-discuss team mailing list archive
-
maria-discuss team
-
Mailing list archive
-
Message #03314
Re: doubt how to create big query
+1, work
Thanks again justin! Happy new year :)
Em terça-feira, 9 de fevereiro de 2016, Justin Swanhart <greenlion@xxxxxxxxx>
escreveu:
> Hi,
>
> Actually ps_history (my performance schema periodic capture tool) uses a
> constructed UNION to get a consistent snapshot of the performance schema.
> It might be more useful to you:
> https://github.com/greenlion/ps_history/blob/master/setup.sql
>
> --Justin
>
> On Mon, Feb 8, 2016 at 9:46 PM, Justin Swanhart <greenlion@xxxxxxxxx
> <javascript:_e(%7B%7D,'cvml','greenlion@xxxxxxxxx');>> wrote:
>
>> Hi,
>>
>> Use a stored procedure to construct the union as from a CSV list of
>> tables and execute it using a prepared statement. Stored routines can
>> return resultsets.
>>
>> Look at sq_helper.sql in Shard-Query for hints:
>>
>> https://github.com/greenlion/swanhart-tools/blob/master/shard-query/sq_helper.sql
>>
>> --Justin
>>
>> On Mon, Feb 8, 2016 at 7:03 PM, Roberto Spadim <roberto@xxxxxxxxxxxxx
>> <javascript:_e(%7B%7D,'cvml','roberto@xxxxxxxxxxxxx');>> wrote:
>>
>>> hi guys
>>> i'm with a problem / possible feature request
>>>
>>> i have many tables with same structure (same fields) and i need to
>>> create a big query with all tables
>>>
>>> something like:
>>>
>>>
>>> select * from t1
>>> union all
>>> select * from t2
>>> union all
>>> select * from .....
>>> ... union all
>>> select * from t99999
>>>
>>> is there anyway to create a big query with some "template c++ like"
>>> feature? something like
>>>
>>> select * from <union all t1, t2, t3, t3, t4....> ?
>>>
>>> ---
>>> Roberto Spadim
>>>
>>> _______________________________________________
>>> Mailing list: https://launchpad.net/~maria-discuss
>>> Post to : maria-discuss@xxxxxxxxxxxxxxxxxxx
>>> <javascript:_e(%7B%7D,'cvml','maria-discuss@xxxxxxxxxxxxxxxxxxx');>
>>> Unsubscribe : https://launchpad.net/~maria-discuss
>>> More help : https://help.launchpad.net/ListHelp
>>>
>>>
>>
>
--
Roberto Spadim
SPAEmpresarial - Software ERP
Eng. Automação e Controle
Follow ups
References