how to write Sql query

Posted by Gow.net under Sql Server on 1/12/2012 | Points: 10 | Views : 921 | Status : [Member] | Replies : 2
here i attach snap shot s i need output that snap shot format but i don't know how to write query using sql please any one guide me

gowthaman8870226416


Responses

Posted by: Hmanjarawala on: 1/12/2012 [Member] Bronze | Points: 25

Up
0
Down
Hi what i understand from your doc file is:

select a.CID,a.firstname,b.age,a.sex,b.pincode,a.address from register as a
inner join (select sex, Min(age) + '-' + Max(age) as age, Min(Pincode) + '-' + Max(pincode) as pincode from register group by sex) as b
on b.sex = a.sex

Himanshu Manjarawala
Sr. Software Engineer@AutomationAnywhere
http://fieredotnet.wordpress.com/

Gow.net, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gow.net on: 1/12/2012 [Member] Starter | Points: 25

Up
0
Down
ya sir i got it
thank u sir


gowthaman8870226416

Gow.net, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response