Skip to main content

Solved

12495 Topics
find next higher number based on certain where-conditions (SQL)

Hi all, sorry, this is more of a general SQL question. I have to find the next higher sequence-number depending on certain where-conditions: Table-example: ╔═══════╦══════════════════╦═══════════════════════════╗║ Seq ║ Start_Time ║ Queue ║╠═══════╬══════════════════╬═══════════════════════════╣║ 34962 ║ 28.07.2020 17:06 ║ PQ_NEW PRICE REQUEST GMDM ║║ 35393 ║ 29.07.2020 11:03 ║ ║║ 35394 ║ 29.07.2020 11:03 ║ ║║ 42886 ║ 04.09.2020 14:16 ║ PQ_NEW PRICE REQUEST GMDM ║║ 42887 ║ 04.09.2020 14:16 ║ PQ_NEW PRICE REQUEST GMDM ║║ 42888 ║ 04.09.2020 14:16 ║ ║║ 42889 ║ 04.09.2020 14:16 ║ ║║ 42890 ║ 04.09.2020 14:17 ║ PQ_COST SWEDEN ║║ 42891 ║ 04.09.2020 14:17 ║ PQ_COST SWEDEN ║║ 42892 ║ 04.09.2020 14:17 ║ ║║ 42893 ║ 04.09.2020 14:17 ║ ║║ 42894 ║ 04.09.2020 14:17 ║ PQ_NEW PRICE REQUEST GMDM ║║ 42895 ║ 04.09.2020 14:17 ║ PQ_NEW PRICE REQUEST GMDM ║╚═══════╩══════════════════╩═══════════════════════════╝ Example select: SELECT start_time FROM table WHERE queue <> 'PQ_NEW PRICE REQUEST GMDM' AND seq I

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings