I have created a native custom query method: And calling EntityManager with: But all I get is: when I print out the list. Number of objects is correct so I assume something with casting is not correct. I do get a warning in my IDE: Why is this happening and how do I get the correct list? Answer You can
Search specific format value in database field
I have to search for specific format values in a database field. Value format as below: ABC 1167:YYYY ABC 45870:YYYY ABC 7654:YYYY ABC 45076:YYYY YYYY- could be a year i.e. 2018, 2019 I tried to …
SQL get records having latest association matching a specific value
Context Using PostgreSQL, I’m storing articles and their associated events. Here is a simple structure of the 2 tables for the sake of the example: Articles table +—-+———–+—————–…
Select date and value between two dates with cumulative sum
I’m trying to sum every day between two dates without lose the last value. A little bit of context: 2020-02-03 have 27 registers 2020-02-04 have 32 registers 2020-02-05 have 28 registers and so on……
How do I write a query to exclude groups of records if at least one record in the group meets a certain condition?
I need to write a query that selects records from a table only if there is no record within a group of records with a specific property. To put this in context, the table is offers (as in real estate)…
like clause in JPA native sql query
I have a query that returns a list of products: @Query(value = “Select * from Product join Product_Pro pp on Product.ID = pp.PRODUCT_ID where A_ID= ?1 order by name”, nativeQuery = true) …
How do I keep data B on a child table that is connected to data A on the parent table, while deleting data A on the parent table?
I’m creating a forum-type web app where users can leave comments based on a specific topic. There are registration and login steps. Right now, when a user account is deleted, everything tied to the …
retrieve unique visits sql not working mysql
I have this table visitors: ip,last_date (datetime) When a different ip enters to the site in an specific day, it insert a new row, no matter if the ip is entering again. Whit this sql statement I …
SQL – Pulling column data from two different tables and using it
I’m trying to pull data from two different columns from separate tables to use in my ranking query. I’m trying to keep data from the left column “PVPRanking” and merging the rest, thus my RIGHT JOIN. PVPScores – Has PVPWins, PVPLose, and PVPGiveUP. While PVPRanking has the rest. I cant seem to properly use this data without getting errors like
SQL: Fetch additional column without adding in GROUP BY
I’ve a query: SELECT asset_ref_id, MAX(updated_at), people_id FROM asset_aud WHERE revtype = 2 AND updated_at BETWEEN TO_DATE(‘2020-05-20T10:09:00’, ‘YYYY-MM-DD”T”HH24:MI:SS’) …