Skip to content

Tag: sql

How to create LinkedList of JPA entities

I have a scenario where I need to create an entity which has references to list of predecessors and list of successors. when a request is received, I need to create entity like below: Request: My new entity “task2” should now be created as below in DB. While saving task2 with previous as task1 and…

get 2nd highest sum in mysql

i have table emp : emp_id quantity 1001 21 1001 10 1002 3 1002 5 1004 4 1004 5 1004 8 i want to get the id having 2nd highest sum so expected output is 1004 17 let me know how can …

Query returns duplicate values [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 1 year ago. Improve this question The query below is showing some duplicate and wrong values: The output should look like this:…

Transaction Mode in SQL

I was reading through the BNF grammar for transaction statements and saw that transaction modes can be specified directly in the START TRANSACTION statement. Is there a difference in specifying transaction modes in START TRANSACTION vs SET TRANSACTION statements? Answer No difference. The SET TRANSACTION sett…