Native Queries

The query() function is executed on a data source connected to MindsDB and saved into a variable. This native query is executed directly on a data source.

Database exampleDB = server.getDatabase("example_db");
Query query = exampleDB.query("SELECT * FROM example_db (SELECT model, year, price FROM demo_data.used_car_price);");

// or

Query query = exampleDB.query("SELECT * FROM example_db (<native query here>);");
Updated on