Skip to content

Tag: sql

PostgreSQL: Sub-Query on one table

My table looks (simplified) like this: It records filenames “File”; sometimes, a file (here BBB) is replaced by a newer one (here CCC”. First show all records, that have been replaced: OK, brings up line 2. Now I need to add a subquery column QQ, which shows the File of the substitute record…

insert Into and Union of Tables

I’m using MS-Access. I have a table A looks like : I need to insert into a table B that looks like: Can I do it with an SQL instruction? Answer If the id field in table B is an Autonumber and ordering of the values is important, then you can use keep in mind that the value field name

JOOQ “IN” Query throws null pointer exception

When we try to fetch data with Null values field(TABLE_NAME.COLUMN_NAME.in(null)) with IN clause getting null pointer exception. Maybe because of this. In the database, we can provide null in IN clause. There is an existing “won’t fix” issue in jooq https://github.com/jOOQ/jOOQ/issues/3867 T…

Get Row based off Date and previous row

I’ve got the following sample data and what I’m trying to do is based off the DateChanged value is get the appropriate Amount from the linked table along with the previous row. The results would then display as How could this be done? What I have so far is this but wondering is there’s a bet…