I have this data; date owner p.code product —- —– —– —— 21.08.2020 Micheal 5 apple 22.08.2020 Micheal 5 apple 15.08.2020 George 4 biscuit 14.08.2020 …
duplicate records in table in SQL with two same column values and one different value
I am having three fields and I want to find out unique records with same c3 and c1 and different c2. My c1, c2 and c3 are column names. I need to find out with in the same c1 and c3 where is c2 …
Use inputbox to filter in asp.net core razor with dapper
I have a query that is already getting data from the DB, Now I want to filter the data using a checkbox from the razor page. Below here is the checkbox I am already getting the values of the checkboxes via string[] Requestloans But the problem is how to filer db with the RequestLoans array using dapper. If th…
MariaDB Pivot Table Performace
I have a table containing data with dynamic categories: +———-+————–+—————+———+ | category | string_value | integer_value | user_id | +———-+————–+———…
MySQL: Select newest two rows per Group
I have a table like this: CREATE TABLE `data` ( `id` int(11) NOT NULL, `deviceId` int(11) NOT NULL, `position_x` int(11) NOT NULL, `position_y` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=…
find the highest occurrence of a point type
How to get the highest repetition for a point type data in PgSQL Need to calculate the most repeated coordinate (more precisely within a range of 100 meters) Sample data column name coordinates …
How do I get the matching id for every record?
My table is called platform_statuses, here is its schema: And this is my query, I would like to also get the matching id for the returned records. Also note that the abs function you see in the query is a custom one I got off this answer. Here is its definition: Answer I understand that, for each account and …
How to create a leaderboard as a database
I need to create a database which is a top 5 leaderboard, however, what I tried didn’t work – it brought up many different errors (code below): Problems: The 4th line beginning “db = ” comes up with an error on the brackets. I initially thought it had to do with the fact that I am tryi…
How to access a local, pre-populated sqlite database using Kotlin in Android Studio?
For a personal project, I am creating a quiz app written in Kotlin. To store information about a given question (four choices, the question itself, a category, and the correct answer), I have created a database using SQLite that stores said information. However, I am not unsure of a couple of things. One is w…
How do I count and sum from different tables (SQL)
I am trying to write an SQL statement that does this: For each customer that has an order, I need to list the customer’s number, the number of orders that customer has, the total quantity of items on those orders and the total price for those items. I then to need sort the result by the customer number.…