Skip to content

Instantly share code, notes, and snippets.

@veekaybee
Created June 30, 2023 09:51
Show Gist options
  • Save veekaybee/fa82d589d511dd5978c3020a8a85be27 to your computer and use it in GitHub Desktop.
Save veekaybee/fa82d589d511dd5978c3020a8a85be27 to your computer and use it in GitHub Desktop.

how to properly select from DuckDB

SELECT review_text,title,description,goodreads.average_rating, goodreads_authors.name 
FROM goodreads 
JOIN goodreads_reviews 
ON goodreads.book_id = goodreads_reviews.book_id 
JOIN goodreads_authors  
ON goodreads_authors.author_id = (select REGEXP_EXTRACT(authors, '[0-9]+')[1] as author_id FROM goodreads) LIMIT 10;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment