From: Miguel Vaz Date: December 13 2009 10:44pm Subject: Join using Table1 or Table2 - depending on content of rel table List-Archive: http://lists.mysql.com/mysql/219707 Message-Id: <5c0cc8f00912131444y78c7a1eclbf7bb0109c2084a2@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=000325556bba235f39047aa3e50a --000325556bba235f39047aa3e50a Content-Type: text/plain; charset=ISO-8859-1 Hi, How would one go about doing this: - I have 3 tables: - A relationship table(REL), then TABLE1 and TABLE2: REL TABLE has fields: . ID . TYPE - type of event . ID_EVENT - id of event, but this id will either point to TABLE1 or TABLE2, depending on the content of the field "TYPE" Is it possible to do everything on the same select? I mean, the join will use a different table depending on the content of one of the fields. This join will retrieve the name of the event, either from TABLE1 or 2. Or should i just do a select to get the first row content, and then get the rest afterwards? Thanks, MV --000325556bba235f39047aa3e50a--