Need some help building a query. I have a table from another DB with 4.5 million records and I want to copy a representational sample of the data out of it,
I think it requires a double select but I can't quite make it work
ie:
i1 i2 i3 misc
100 100 19 xxx x x x
100 100 20 x x xxx x x x
100 101 21 x z z z z
100 101 22 x z z z z
100 102 23 z z z z z
101 102 34 z z z zz
101 102 35 z z z zz
101 104 30 z z z z z
something like select distinct i1 i2 -> copy entire first record into new table
final
100 100 19 xxx x x x
100 101 21 x z z z z
100 102 23 z z z z z
101 104 30 z z z z z
SQL is not my thing, yet, but working on it
I think it requires a double select but I can't quite make it work
ie:
i1 i2 i3 misc
100 100 19 xxx x x x
100 100 20 x x xxx x x x
100 101 21 x z z z z
100 101 22 x z z z z
100 102 23 z z z z z
101 102 34 z z z zz
101 102 35 z z z zz
101 104 30 z z z z z
something like select distinct i1 i2 -> copy entire first record into new table
final
100 100 19 xxx x x x
100 101 21 x z z z z
100 102 23 z z z z z
101 104 30 z z z z z
SQL is not my thing, yet, but working on it