I have a table that contains 2 rows per record. the initial record and then the record when its ended they contain the same information apart from one column on the second row has the completed …
Calculate read pages through select query in reading progress table
I have a small program that I use to track my progress in reading books and stuff like goodreads to know how much I read per day. I created two tables for that, tbl_materials(material_id int, name …
Extract fields from postgres jsonb column
I have a postgres table with jsonb column, which has the value as follows: id | messageStatus | payload —–|———————-|————- 1 | 123 | {“…
MySQL select boolean fields and create 3rd states
I’m using MySQL and I want to get a boolean with 3 states (-1,0,1) on existing fields. E.g if I have col1 = null or row doesn’t exist col2 = 0 col3 = 1 Then I do : SELECT col1, col2, col3 FROM …
Nesting a table, column of type string in BigQuery
I have a query that I am running against my dataset in BigQuery. The data is partly the google analytics data for a particular website. I want to be able to nest the string values for my key_web, to …
How to Update a column Before Select?
I am setting a stored procedure for select and I want to update the value of one column in the database Before doing the Select. This is what I tried but it’s not working. @roleID int and @query …
How to remove one or more instances of ‘?*’ in a string using REGEXP_REPLACE function in oracle?
I’m getting the characters ‘?*’ one to three times in a column called Line. I am required to remove these characters. How do I do it using Replace or REGEXP_REPLACE? SELECT Line, REGEXP_REPLACE(…
paging and sorting with Jpa returns only around 10% records from db
When I try to retrieve data from JpaRepository with Pageable request it only return 10% from all records. as example I had 68 records in MySQL database and pageble request only return first 10 records. when i try to get 2nd resultset it returns empty page content object. but if I request 100 records in one request it return all
Count Dimension Items that All Have the Same Value in Another Field
I have a table that looks like the following: business_id, employee_id, and status, which is either ‘active’ or ‘inactive’ I want to count the number of businesses where ALL of its employees are “…
SQlite Insert or replace conditional on each column value being bigger than it’s current value
I’m in a situation where I can have the same record appear several times. The trouble is that some of the fields may be missing, this is denoted by a value of -1 in that field. The value of the field …