MYSQL Merging 2 results into 1 table

Posted by AlphaRomeo69 on Stack Overflow See other posts from Stack Overflow or by AlphaRomeo69
Published on 2013-11-05T03:51:24Z Indexed on 2013/11/05 3:53 UTC
Read the original article Hit count: 394

Filed under:
|

Im building a c# program and am currently stuck at fetching data from MYSQL database and bind them to a grid view. I had been researching for a few days now but to no avail.

I have 4 table in the database.

table 1 - alpha table 2 - bravo table 3 - charlie table 4 - delta

attributes of alpha (id, type, user, role ) attributes of bravo (id, type, date, user) attributes of charlie (id,type, cat, doneby, comment) atttibutes of delta (id,type, cat, doneby) * the pk of alpha and bravo is (id) * the pk of charlie and delta is (id, type)

i did a query1 before by inner joinning alpha, bravo and charlie which leads to the sucessful result of (id, type, date, user, role, cat, doneby, comment)

and

i also did a query2 before by inner joinning alpha, bravo and delta which leads to the sucessful result of (id, type, date, user, role, cat, doneby)

Right now, im trying to built a query3 which will merge the result from query1 and query2 together.

the result of my attempts leads to (id, type, date, user, role, cat, doneby, comment,id, type, date, user, role, cat, doneby)

As i do not want the repeated columns, I would like to seek advice on how to get the result to become like the one below by placing the records as a new tuple in the result table. (id, type, date, user, role, cat, doneby, comment)

Thanks!

P.S: the PK would not pose a problem due to (id, type)

© Stack Overflow or respective owner

Related posts about c#

Related posts about mysql