# redivis$query

### **redivis$**<mark style="color:purple;">**query**</mark>**(query)** → [Query](/api/client-libraries/redivis-r/reference/query.md)

Execute a SQL query across any tables on Redivis.

### **Parameters:**

**`query` :&#x20;*****str*** \
The SQL query to execute. Must follow the [Redivis SQL query syntax](https://docs.redivis.com/reference/projects/transform-nodes/raw-sql).

### **Returns:**

[**Query**](/api/client-libraries/redivis-r/reference/query.md)

### Examples

```r
# The query can reference any table on Redivis 
query = redivis$query("
    SELECT * 
    FROM demo.iris_species.iris 
    WHERE SepalLengthCm > 5
")
query$to_tibble()
# 	Id	SepalLengthCm	SepalWidthCm	PetalLengthCm	PetalWidthCm	Species
# 0	33	5.2	        4.1	        1.5	        0.1	        Iris-setosa
# ...
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.redivis.com/api/client-libraries/redivis-r/reference/redivis/redivisusdquery.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
