MySQL IF... SELECT statement whilst retaining column headers -
fumbling in dark mysql isn't bad. (i coding novice)
i have massive database need join database (in arc gis). did code joining database headers (necessary join) surprisingly didn't come standard when generating sub data sets mysql.
as still 3 million records need wittle data down. did querying whether contained part of grid square reference (but no titles!). i'm trying see if contains image number (grid_image) whilst retaining column headers. if field contains number select ... outfile.
i'm struggling if though, appreciated :).
laura
code far:
where geograph_db.image_numbers.column1 = geograph_db.gridimage_geo.gridimage_id select 'gridimage_id','nateastings','natnorthings', 'view_direction' union select gridimage_geo.gridimage_id, gridimage_geo.nateastings, gridimage_geo.natnorthings, gridimage_geo.view_direction outfile 'geo.csv' fields terminated ',' optionally enclosed '"' geograph_db.gridimage_geo ;
sorry awful.
here syntax should be, think.
select 'gridimage_id','nateastings','natnorthings', 'view_direction' union select gridimage_geo.gridimage_id, gridimage_geo.nateastings, gridimage_geo.natnorthings, gridimage_geo.view_direction outfile 'geo.csv' fields terminated ',' optionally enclosed '"' geograph_db.gridimage_geo, geograph_db.image_numbers image_numbers.column1 = gridimage_geo.gridimage_id;
Comments
Post a Comment