Mysql query help in group concat

  • httpftp21
  • Graduate
  • Graduate
  • httpftp21
  • Posts: 101

Post 3+ Months Ago

Hi All

I have three tables
1. MetaKey
Colmans:
ID KeyName
1 hobbies

2. MetaKeyValue
Colmans:
ID KeyValue
1 skating
2 rugby
3 TV

3. ObjectType
ID ObjectName
1 World
2 Branch
3 Customer

4. MapMetaKeyMetaValue
Colmans:
ID KeyID ValueID ObjectID(Branch or Customer ) ObjectTypeID isLive
1 1 1 1 (Branch ID) 2 Y
2 1 2 1 (Branch ID) 2 Y
3 1 3 1 (Branch ID) 2 Y
4 1 1 1 (Customer ID) 3 Y
5 1 2 1 (Customer ID) 3 N


5. Branch
Colmans:
ID ObjectName
1 Test

6. Customer
Colmans:
ID Customer Name
1 TestCustomer

Now when i am at customer page i need all the Key&Values associated with Bank, at the same time Key&Values associated with the customer
As below:

Now i need a query that will give following result
KeyValues KeyID keyName
MetaKeyValueID|KeyValue|isLive

Some example Results

KeyValues KeyID keyName
1|World|Y,2|rugby|N 1 hobbies

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 37 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.