S
subs
Original table
ocity year price
frankfort 2008 1200
frankfort 2009 500
hopkinsville2008 200
hopkinsville2009 120
indiana 2009 12
pa 2008 8
Required table
ocity 2008 2009
frankfort 1200 500
hopkinsvill 200 120
indiana 12
pa 8
hi
i need a join SQL query which can get me the required output as above.
I am comparing 2009 and 2008 prices for every ocity. I need to get all
records which is present in the original table even if there are no
matches( eg indiana and pa). but i donot need any duplicates. Thanks i
appreciate a lot
ocity year price
frankfort 2008 1200
frankfort 2009 500
hopkinsville2008 200
hopkinsville2009 120
indiana 2009 12
pa 2008 8
Required table
ocity 2008 2009
frankfort 1200 500
hopkinsvill 200 120
indiana 12
pa 8
hi
i need a join SQL query which can get me the required output as above.
I am comparing 2009 and 2008 prices for every ocity. I need to get all
records which is present in the original table even if there are no
matches( eg indiana and pa). but i donot need any duplicates. Thanks i
appreciate a lot