My Current Table looks as follows public.transactions storeId FeatureA FeatureB FeatureC Details 123 true false false … (JSON) 123 false false false 123 …
SQL – Insert rows on missing value with previous row information
I have queried the tables in a SQL Server database that return a result set with CId (the CId can be in range from 0 to 6) with the quantities. Result: I want to insert the missing CId into result table with previous row CId -> qty, if there is no previous value in group then insert qty as 0
How to use a SQL query in Google Sheets to group by a substring
In my table, in Google Sheets, I have a column B called “description” and I’m trying to write a SQL query to group by substrings of column B. Values in B are like “Sell 1 Jan11 300.0/307.5 Strangle” …
Filter rows in DataSet using JPA/Hibernate
I have the following code which is used to retrieve data from multiple tables (using joins) and then mapping every row into a DTOList but I also need to apply filters based on user preferences: per …
Get active weeks from start and end date
I have subscriptions data as shown below. The data shows when a user bought a subscription. It has user_id,subscription_id,start date and end_date. I have derived wk_start and wk_end from it. +——…
SQL: How to create a database view from tables with OneToMany Relationship?
There are three available tables and columns: Core – EmpID, EmpName 1, Yagga Boshu External – ExternalEmpID, ExternalDeptName 1 , Capegemini Position – EmpID, Dept P/S …
How can I get a record to be counted in multiple columns of a Crosstab Query?
Background information: My company requires employees to maintain at least one certification (cert) on a position. There are a total of 17 different certifications that an employee can get. An …
Using Where statement on comma seperated value in sqlite
I have sqlite database with table containing comma seperated fields like that: Data Field containing: Frank; 34 California street; 0123456789 FieldData Field containing: Name; Address; Phone …
grouping rows while being able to show columns from each row in the group
I’m sure the title is not clear enough, couldn’t find a better way to explain what I need. I’m using PostGreSQL 11.4 i’ll minify the problem i’m having to show the actual issue. I have a query that …
Postgresql tuple constraints about NOT NULL
I am building a database in POSTGRESQL, and I would like to create NOT NULL constraints for my columns, where one and only one column would be NOT NULL. I have two columns in my table, site_id and …