joins pls help

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

JOins pls help 4
SQL query urgent pls help 2
access joins 1
sort a table uniquely 9
table joins 2
Join queryies- urgent 1
Pls help with SQL query 12
phone 1

Top