On Oct 26, 8:48 pm, AF <[email protected]> wrote:
> Hello,
>
> I don't know if this is even possible is SQL, so please bear with
> me.... :)
>
> There are a couple a tables (say, a & b) that are used as "logs" for
> two different processes.   They both have the same simple structure.
> (id, time_stamp, user_id, message)
>
> I would like to create a query that merges the data and returns
> following results:
>
> "time_stamp, user_id, a_or_b, message"
>
> (where a_or_b is a value that indicates which table the data row came
> from)
>
> Can this be done in SQL/SQLAlchemy.
>
> Thank you,
> :)
>
> p.s.
>
> Alternatively, the message columns do not need to be merged.... though
> I guess time_stamp / user would still need to be.
>
> That is:  "time_stamp, user_id, message_a, message_b"
>
> I don't know if that makes any easier...


OK:
http://www.w3schools.com/Sql/sql_union.asp

Doh.   OK, so now I have an SQL statement I wrote by hand that works
fine, but I still have two questions:

1) Can this be done via the SQA ORM?
2) If not, how should I I build this using non-ORM SQA?

Thank you,
:)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to