How to create a query for below situation
I have some dynamic control which is generating from database. Its control details are storing like below in table.tblControl
ControlName. ControlText
-------------------------------------------------
chkMaleYes. Sex...
chkMaleNo. Sex...
And these control values are saving to another table from page; which is given below.
tblData
ID. ControlName.. Value
-----------------------------------------------
1. chkMaleYes. Yes
1. chkMaleNo. No
2. chkMaleYes. No
2. chkMaleNo. Yes
Above table means in one save it will inserts two rows... ID 1 means they selected Male from page; ID 2 means they selected Female.... Form the above data; I need to get result like
ID. Sex
------------------
1. Male
2. Female
If need then we can add some additional columns....