Click here to Skip to main content
15,921,452 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
XML
subject                 max     min      date

Chemistry(theory)   179 15  2014-06-04
Chemistry(practical)    100 22  2014-05-03

<b></b>
i want this records mentione below

 subject        theorymax    theorymin    theorydate   practicalmax   practicalmin  racticaldate

Chemistry   179      15           2014-06-04      100           22            2014-05-03
Posted

1 solution

You can use below query to get the result

SQL
Select REPLACE(T1.subject,'(theory)','') subject, 
       T1.max theorymax,
       T1.min theorymin,
       T1.date theorydate ,
       T2.max practicalmax,
       T2.min practicalmin,
       T2.date practicaldate 

FROM YourTable T1 LEFT JOIN 
     YourTable T2 ON REPLACE(T1.subject,'(theory)','') = REPLACE(T2.subject,'(practical)','')
WHERE T2.subject IS NOT NULL
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900