What is the fastest and most efficient way to create a table based on unique values from…
- User
What is the fastest and most efficient way to create a table based on unique values from a large number of other values in one column?
Assistant
The fastest and most efficient way to create a table based on the unique values from a large column in DuckDB is using along with the keyword:
- User
I meant to ask what is the fastest and most efficient way to create a table based on unique values from a large number of other tables but only from one column?
Assistant
- User
Is there any better solution than this: CREATE TABLE unique_values AS SELECT DISTINCT * FROM pragma_union_all('SELECT column_name FROM ?', (SELECT table_name FROM tables_list));
Assistant
While
pragma_union_allcan be useful in dynamic situations where table names are retrieved from a query, it's often not the most efficient solution for creating a table of unique values from a single column across multiple tables. The approach is generally preferred.- User
What if there is only one table that I don't want to access
Assistant
If you have a single table and you want to create a new table containing unique values from a specific column without accessing the original table directly (perhaps because it's very large, or access is restricted), then you'll need some way to get the data you need indirectly. Here are a few possibilities, depending on your situation:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.