Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execute SQL SELECT statements on sheet data. #3

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

demmings
Copy link

  • An enhancement over the Google Sheets QUERY() function.
  • All common SQL SELECT syntax is supported.
  • For more information about using: https://github.com/demmings/gsSQL
  • Basic use:
=gsSQL( SelectSqlStatement, [TableDefinitions], [ColumnOutputFlag], [BindVariableData])
  • SelectSqlStatement ==> Your SELECT statement.
  • TableDefinitions ==> "table1", range, "table2", range,...
  • ColumnOutputFlag ==> true/false. Include column names in output.
  • BindVariableData ==> As many variable data items that are referenced in SELECT. The first one is replaced in SELECT as ?1. The second one is ?2, and so on...
select * from sales where date > ?1
  • Example:
=gsSQL("select transaction_date, sum(gross), sum(amount)
          from 
             mastertransactions 
          where 
             transaction_date >= ?1 and transaction_date <= ?2 and expense_category in
           (select income from budgetCategories where income <> '') 
           group by 
               transaction_date pivot account", 
           "mastertransactions", 'Master Transactions'!$A$1:$I, "budgetCategories",budgetIncomeCategories,
 true, '01/01/2022', '05/19/2022')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant