Hey, I keep searching the forum, but can't exactly what I need.
I have a table (tbl_road) with tons of fields. I need to create a new table (tbl_road_disti nct) with unique values of an field (road_id), as there are multiple values,. So, this works fine
thats fine, but i want it to bring the rest of the attributes associated with the unique records over too (ideally the first occurrence of each record). I Do not have a PK either as its just a temp table..
Any thoughts would be greatly appreciated
Eric
PS I am working with MySQL 5.*
MySQL Query Browser 1.*
on Windows XP
I have a table (tbl_road) with tons of fields. I need to create a new table (tbl_road_disti nct) with unique values of an field (road_id), as there are multiple values,. So, this works fine
Code:
CREATE TABLE tbl_road_distinct SELECT DISTINCT (road_id) FROM tbl_road
Any thoughts would be greatly appreciated
Eric
PS I am working with MySQL 5.*
MySQL Query Browser 1.*
on Windows XP
Comment