6

Having the following statement:

SELECT * INTO ZZZD FROM P4978

Output:

result
time                    written
1970-01-01T00:00:00Z    231

Using:

SELECT * FROM ZZZD 

I get only 7 lines even if there where 231 lines written. I can't figure why there are only 7 lines. Is there some setting or this is a defect? I'm not able to copy from a measurement to another measurement more than 7 lines.

sarbo
  • 1,661
  • 6
  • 21
  • 26
  • 1
    Fixed the problem using the GROUP BY, now I have the following query: SELECT * INTO ZZZD FROM P4978 GROUP BY "component" – sarbo Mar 03 '16 at 12:56

3 Answers3

17

If you want an exact copy use:

SELECT * INTO ZZZD FROM P4978 group by *

If you don't specify group by *, the tags will turn into fields.

You can verify the tags with show tag keys from ZZZD and the fields with show field keys from ZZZD

Source: https://docs.influxdata.com/influxdb/v1.5/query_language/continuous_queries/#common-issues-with-basic-syntax scroll to issue-4

2

Into clause is now working with influxDB 0.12 and above.

SELECT * INTO ZZZD FROM P4978 

This will work

Ammad
  • 4,031
  • 12
  • 39
  • 62
-3

The INTO clause is intended for use with the downsampling continuous queries. Kapacitor is a better tool for copying data from one measurement to another.

beckettsean
  • 1,826
  • 11
  • 7