I am inserting parent records and child records at the same time in a stored procedure. Rather than have outside code make nested calls to create each parent and then each child of that parent (which is even slower than my current approach), I am giving the sql a comma separated list of child types that I put…
Updating webclient response from database
I have situation where I can’t update column at database. The problem is that only method setIsPurchased is executed and the flag is_purchase at SQL table changed to true, but the next line with setPurchasedDate which has to set current time is not executed. The response from database is Mono<Void>…
Spring Data JPA Native Query N + 1 problem
I’ve run into some code which behaviour is not clear for me. We have first entity: @Data @Entity @Table(name = “Info”) public class Info { @OneToOne @JoinColumn(name = “data_id”) …
MYSQL JOINS, Got Stuck [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 6 months ago. Improve this question good day! i’m in the middle of learning new thing in mysql, i need join 2 tables, tab…
Respecting GROUP BY Clause in a MySQL SUB-QUERY
I have a query which returns some figures from a table of sales data. The table contains data for a number of different sales managers. I need to return data for the individual managers and also some calculated figures. One of the figures I’m trying to get at involves a subquery. Getting the figures for…
MYSQL Update same column with multiple where clause
I found this question, seems like same as mine. However, there’s a little difference between the two as that one is using the same column in where clause and I have a different one. This is what I’m trying to achieve; is it possible to do that in one query? EDIT: The data type of recent is Boolean…
Is there any way we can emulate the way of using :old and :new of row triggers in statement triggers in PL/SQL
Good Day Buddies! So, here is my Question, it says – Write a update, delete trigger on clientmstr table. The System should keep track of the records that ARE BEING updated or deleted. The old value of updated or deleted records should be added in audit_trade table. (Separate implementation using both ro…
How to make a unique constraint on date that there is no row with date within x months
I have a table that has a timestamp column something like: table Elements I would like to put a unique constraint on the table that will make sure that there are NO two entries with the same name and type and are within X months of any other row. I have asynchronous processes that push rows into this table, a…
Is a SQL trigger faster than a if statement on a interface [closed]
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed last year. Improve this question In a big data scenario, where a piece of code has to run tens of thousa…
SQL – Get the MAX COUNT access peak having only entrance and exit date
I have a table that keeps the access to our system, and it have two columns called entranceTime and exitTime Eg: What im trying to get is the “peak” of simultaneous connections, i tried using a subquery with MAX and COUNT like this: But with this query im getting the count of 5 instad of 3, is it …