Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
SunnyBoy
Starting Member
3 Posts |
Posted - 2011-11-07 : 12:47:49
|
Hi! I have 2 tables sharing same 2 columns and remaining different columns. I want to create a new table using a SELECT query that includes only 1 row from either table with the lowest value for that group of items.For example,Table A Table B--------- -----------color value color valuered 1 red 4red 2 yellow 2red 3 blue 1yellow 1yellow 2blue 2Result wanted:Table C----------color valuered 1yellow 1blue 1I need to group by color and new table includes one row with the lowest value only. Could someone help me with the SQL for this.Thanks in advance,Sunny |
|
X002548
Not Just a Number
15586 Posts |
|
SunnyBoy
Starting Member
3 Posts |
Posted - 2011-11-07 : 17:03:49
|
Thanks Brett. I tried this and i got an error, are we missing an open bracket somewhere?Sunny |
|
|
X002548
Not Just a Number
15586 Posts |
|
SunnyBoy
Starting Member
3 Posts |
Posted - 2011-11-08 : 10:16:40
|
Sorry, Brett. I am using MS Access.Sunny |
|
|
|
|
|