# Tags and Keys "conflicting"

**URL:** <https://community.influxdata.com/t/tags-and-keys-conflicting/11659>\
**Category:** Welcome & Getting Started\
**Created:** [October 18, 2019, 3:41pm UTC](https://community.influxdata.com/t/tags-and-keys-conflicting/11659 "2019-10-18T15:41:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![avrhack](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@avrhack](https://community.influxdata.com/u/avrhack)\
**Post date:** [October 18, 2019, 3:41pm UTC](https://community.influxdata.com/t/tags-and-keys-conflicting/11659/1 "2019-10-18T15:41:18Z")

</div>

Being new to influxdb I copied a measurement with SELECT INTO but did not appreciate the need to add the GROUP BY clause to keep the ‘location’ tag as a tag rather than a field key.

Since then more data has been written with ‘location’ correctly as a tag with the result that my data set is a mess with the older data having ‘location’ as a field key.

I’ve tried copying out to a new data set using two selects:

SELECT location::field, xyz INTO destination WHERE location::field != ‘’ GROUP by location  
SELECT location::tag, xyz INTO destination WHERE location::tag !- ‘’ GROUP by location

But I then just get location and location\_1 as ‘columns’ in the data set.

I can basically find no way to recover from this mess ie get all of the locations whether they exist as tags or field keys in the source data set, into one tag key set in the new data.

Anyone care to explain how to do this? Really finding influxdb a nightmare to use to be honest…
