Exclude some fields from Select query

Hi I have a measurement with over 200 fields, when i select (*) it returns too many data, there are a lot of fields that i want to exclude from the select query, how can i exclude it?

This is the query i’m using:

SELECT * FROM “Rows size (bytes)” WHERE (“servername” =~ /Server$/ AND “type” = ‘Database size’) AND time >= now() - 1h and time <= now()

I tried this one but it’s not working:

SELECT * FROM “Rows size (bytes)” WHERE (“servername” =~ /Server$/ AND “type” = ‘Database size’) AND time >= now() - 1h and time <= now() AND _field!=“excludedb”

Any suggestion?

It’s hard to suggest without knowing your schema, but may be filtering necessary fields using regular expressions could help:

Use a regular expression to specify field keys and tag keys in the SELECT statement

Hi,

I have over 200 fields (database name) - i use telegraf for collect sql database metrics. telegraf use database name as a field instead of tag.

I don’t know the list of database, but i know a list of database that i want to exclude as it has some patterns , the name of database i want to exclude is more than the one i should include ( i don’t know this list and it doesn’t have any pattern).

So i need a way to exclude as i know what needs to exclude.

You can convert field to tag using [processors.converter.fields]