I have a column name called daily_recon I want to update it to 0 where daily_recon is #REF!. I get an error that says the column name daily_recon is ambiguous on the where statement. How do I fix this,…
Postgresql SELECT sample with FOR loop
I have a task where I need to create a 1000 sample row limit query for each attribute selected. So for example if I have: I would need to turn this in to: Problem is that I have a lot of these attributes and that I might be adding more attributes later. Is there a better way of writing this?
Instance member can’t be accessed using static access
I hope you are all doing well ! I have ran into a problem concerning my Flutter app : I’ve been following a tutorial on Youtube on how to use sqflite in Flutter, and I couldn’t get my toMap function …
Sample from groups proportional to score
I have data with the following structure: CREATE TABLE if not EXISTS scores ( id int, class char, score float ); INSERT INTO scores VALUES (1, ‘A’, 0.5), (1, ‘B’, 0.2), (1, ‘C’, 0.1), (2, ‘A’, …
Consolidate information (time serie) from two tables
MS SQL Server I have two tables with different accounts from the same customer: Table1: ID ACCOUNT FROM TO 1 A 01.10.2019 01.12.2019 1 A 01.02.2020 09.09.9999 and table2: ID ACCOUNT FROM TO 1 B …
How to prevent unintended default values from MyBatis queries?
I have the following Java class: The class represents a database table called example. I can use the following SQL query to fetch Example instances from the table with MyBatis: Let’s say that I will add a new field to the table and the class: boolean third. However, if I don’t remember to add the …
Calculating the cumulative sum with a specific ‘date’ merged to single column in PostgreSQL
I have a database which contains the amounts and dates per user paid. Now some users make payments on the same day and I want to show the cumulative sum of these payments only once per day in a pivot …
Struggling with a nested where, group by and min/max in SQL
I have this table in MS Access and need to write a query for a report and am struggling. My SQL is largely unused for at least 5 years, and was never really that good, but I thought I could do this …
Keeping tally of users who meet more than one condition
I have a database of users (represented by visitorId) who belong to a specific channel and exhibited certain behaviors, as logged under the eCommerceActionType field. channel visitorId …
Group by month and name SQL
I need some help with SQL. I have Table1 with columns Id, Date1 and Date2 Table2 with columns Table1Id and Table2Id Table3 with columns Id and Name Here is my try: I need to take Count(date2)/Count(date1) grouped by monthes and name. I have no idea how to do that, as there is no table with monthes. DB –…