C cnicolapc Active Member Licensed User Longtime User Oct 22, 2011 #1 Hi, I have a database with a table Categories that contains a column category. In listview I want to show the list of categories and the record count for each category. Someone can indicate how to use the COUNT function with the GROUP BY in B4android? Thanks in advance Nicola
Hi, I have a database with a table Categories that contains a column category. In listview I want to show the list of categories and the record count for each category. Someone can indicate how to use the COUNT function with the GROUP BY in B4android? Thanks in advance Nicola
Erel B4X founder Staff member Licensed User Longtime User Oct 22, 2011 #2 SQL syntax is not special in Basic4android. It is processed by the SQLite engine. If you are using DBUtils you can use DBUtils.ExecuteListView. The query should be something like: Code: Copy SELECT category, count(category) FROM Categories GROUP BY category Upvote 0
SQL syntax is not special in Basic4android. It is processed by the SQLite engine. If you are using DBUtils you can use DBUtils.ExecuteListView. The query should be something like: Code: Copy SELECT category, count(category) FROM Categories GROUP BY category
C cnicolapc Active Member Licensed User Longtime User Oct 22, 2011 #4 Hi, If you do not ask too much, I have a practical example on how to fill the listview with the category name and the record count in it? is probably simple but I can not figure it out. thanks in advance Nicola Upvote 0
Hi, If you do not ask too much, I have a practical example on how to fill the listview with the category name and the record count in it? is probably simple but I can not figure it out. thanks in advance Nicola
Erel B4X founder Staff member Licensed User Longtime User Oct 22, 2011 #5 See DBUtils.ExecuteListView: DBUtils - Android databases are now simple! Upvote 0