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:
For each distinct PK I have a mixture of TRUE/FALSE
If a PK has one YES value, I want all the other values to be YES. I am thinking going a CTE route that I join back in but was wondering if there is an easier way! I am trying to get my table to look like this if only one Y is in the table above.: Answer I strongly
How to query data in Oracle SQL that gives the max value of a column and the corresponding columns for that row?
I have a Oracle SQL query that I’m trying to get the MAX value of t4.workers column along with its corresponding columns in that row, but I only want to see one row for each project along with the max workers and the max date of the row with the max workers. Example Data: project date vendor workers 4012 01-JAN-21
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
Creating a SQL Loop to Change the Table Name
I am needing to change the ending number of the table name in a loop to go from 1 through 12. This is a more straight forward example of my actual problem, but if this can be solved, then I can duplicate the results later on (Actual problem is using the past 12 months on a rolling basis for a
postgres: Any way to insert multiple tables into another table in the same query?
So I have a bunch of tables and I want to insert them all into another table where all entries from the table and with a label of the name of the title of their table. Here is a sample of what I want to be doing but with also logging in old users at the same time from an
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
MS SQL handling null values same as strange string
I have a view V_BaseData_Extract in MS SQL server with one column Comments having null values as well having other textual values too. Column type is nvarcahr. What’s happening is that SQL returning …
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