MySQL Forums
Forum List  »  Newbie

Need help with query
Posted by: Lennart Nordhus
Date: September 12, 2014 03:53AM

I have 2 tables.
Id in Table1 corresponds to NameId in Table2


Table1
Id | Name
---|---------------
1 | Name1
---|---------------
2 | Name2
--|---------------

Table 2
NameId | ColoumID | Value
--------|----------|------
1 | 1 | Value1
--------|----------|------
1 | 3 | Value2
--------|----------|------
1 | 2 | Value3
--------|----------|------
1 | 5 | Value4
--------|----------|------
1 | 4 | Value5
--------|----------|------
2 | 1 | Value1
--------|----------|------

Is it possible to make a query which give this output:
Id Name Value (ColumnID 1-5)
1 Name1 Value1 Value2 Value3 Value4 Value5
2 Name2 Value1 .....

Options: ReplyQuote


Subject
Written By
Posted
Need help with query
September 12, 2014 03:53AM
September 12, 2014 04:45AM
September 12, 2014 08:58AM
September 15, 2014 04:28AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.