![]() ![]() ![]() Make sure to replace "YourTableName" with your actual table name throughout. Base is also compatible with common database software such as MySQL and JDBC. So with the totals: SELECT X."Type",įROM (SELECT CASEWHEN("Taste" = 'Bad',1,0) AS "Bad", Download LibreOffice for free and get an open-source alternative to Office. The query you will UNION ALL with is basically the same query, you just don't group by the types. (This will disable certain form and report functionality that requires the parser - it may not matter for your usage, but just FYI for if you later use this query in a form or report.) For this query to work you will need to turn on the Edit→ Run SQL Directly option. The Libre Office suite is a free, open-source bundle of six office productivity tools: Writer (word processing), Calc (spreadsheets), Impress (presentations), Draw (vector graphics and. To get the totals row at the bottom, you have to use UNION ALL which is not supported by the Base parser. ![]() The subquery creates the columns "Bad", "Good" and "Delicious" with a 1 or 0 in each column, then the outer part of the query adds up all the values. The first two lines can be done in one query with a subquery clause: SELECT X."Type",ĬASEWHEN("Taste" = 'Good',1,0) AS "Good",ĬASEWHEN("Taste" = 'Delicious',1,0) AS "Delicious", ![]()
0 Comments
Leave a Reply. |