I am not more familiar with MySQL.i want to select some column fields as values from another table by applying some customized conditions I tried out with some queries but not getting the proper result since it has some inner options. please advice me on this

Thanks in advance

please refer to the fiddle.


  • What's the "expected data"? – Rick James Mar 2 '20 at 2:57
  • @ Rick James Thank your for your reply. my expected out put may like this . dbfiddle.uk/… – Muhasseena T U Mar 2 '20 at 4:08
  • Using row values as column names for other queries isn't a way SQL works. If you're after a general attribute system take a looks at some existing options in Rick's EAV guide. – danblack Mar 2 '20 at 6:28
  • The second part of your desired output is the "un-pivot" of your first table. – Rick James Mar 2 '20 at 16:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.