10 Replies Latest reply on Sep 28, 2016 8:09 AM by Luciano Vasconcelos

    How to identify the source table in a database with different tables?



      I am having some problems working with a database. This database have some tables that are joined with table 1 in this way:


      Table 1 [id_] -----------------table 2 [user_id]

                        -----------------table 3 [user_id]

                        -----------------table 4 [user_id]


      So I want to work with the count '_id' but i need to filter by the source table, so i need to identify if 'id_' is in table1, table2, or/and table4.


      How can I do this? I know with UNION I can get something similar, but I can't use this join with my odbc connection. Maybe with a calculated field??


      Thank you in advance