Skip to content
Advertisement

Fill Array from another column SQL

I need help whit my Code (PostgreSQL). I get in my row Result {{2.0,10}{2.0,10}} but I want {{2.0,10}{3.0,20}}. I don’t know where my error is. Result is text [ ] its must be a 2D Array This is Table1 Nummer Name Result 01 Kevin This is Table2 Nummer Exam ProfNr 01 2.0 10 01 3.0 20 My Code is Answer

Getting an element and the next from a table

I have a table with ids, cities and some sequence number, say: I want to get the city that comes after Rome for the same id, in this case, I can order them by doing something like: I get: and, I want to get How do I proceed? Answer Hmmm . . . I might suggest window functions:

Finding max count of product

I am trying to find max count of product. The result must only display the brands which have max number of products in it. Can anyone suggest a better way to display result. Here are the table details: I have used this SQL query below but I am seeing an error below. The result must display the list of the

Trimming the beginning and end of string in SQL

I have quite a long string that I want to trim the beginning and ending of. See a random example below: { “topic”: “birds”, “body”:”cool bird”, “attachment1″:”bird1”, “attachment2″:”anotherbird” } My desired output: “attachment1″:”bird1”, “attachment2″:”anotherbird” I want to keep the attachments so I would have to trim everything up to the first attachment “attachment1” and get rid of the ‘}’ as

How to retrieve the id stored in a session?

I have a form that allows you to register and log in and a reservation form that allows you to choose a date and time. I would like to be able to retrieve the user id and in my ‘Bookings’ table in the ‘user_id’ field. My Database looks like this : My Database And the form that fills my booking

Advertisement