I’m transforming Data in a JSON by using that code and get a result, that is pretty okay. But I need it in another format, so that our agency is able to use the data. This is the Code I use: The Result I get is every row as a JSON with squared brackets, which makes absolutely sense: But what
Tag: sql
c# ef core RemoveRange contraint violation
Hi I have a complex db with many tables and relations what we want to do is to copy all tables from a database to another but only taking rows starting from one table (salesorder) and going down following relations. So I avoided the .Include, and use IQueryable queries (one for each table) there is no problem…
Display value in column although it is excluded by a WHERE condition over another column
DB-Fiddle Expected Result: In the result above I want to list all itemID and orderID that have shipped_volume > 0. Therefore, I went with this query: It gives me almost the result I am looking for. The only issue I have is that it puts a 0 for all rows in column sum(order_volume) which is caused by the WHE…
Variable value conversion from any case to smaller case in psql CLI
I was creating a script to create DB user in Postgres via psql CLI, the challanges I am facing is that value conversion from Any case to lower case is happeing or not able to find the solution for the same. As per my expectation the lowerVal variable should convert the inputValue into lower case value. Did th…
Create a descending list of orders per item and display the ranking position in seperate column
DB-Fiddle Expected Result: In the results above I want to create a descending list of all orderIDs per itemID. Starting from the newest order to the oldest order which is defined by the event_date. The position of an orderID within a certain itemID should be displayed in column position. I tried to go with th…
How to combine these two SELECT statment into one
I have two SELECT query which are written in MySQL AND So far I have to translate these two query to Oracle PL/SQL‚I came in idea to combine these two statment into one and so far I write query but I am a little bit confusing since I am begginer in PL/SQL Here is graphical representation of tables CategoryTab…
Group by + sum for different thresholds (preferably in a single query)
Let’s say I have a table with 3 columns: Column A: Client_ID (not unique, can appear in multiple rows) Column B: Price paid for a product Column C: Product (type) I want to get 6 columns: i.e With Client_ID x Product unique I think the first part can be achieved with a simple GROUP BY However, how can I…
cs50 pset7 houses syntax
I’m working on the roster.py part of the problem and I’m getting the error: My code: Answer Your quotes are wrong. Try this:
How to extract all tables (including where references) within a SQL query?
I’m working on a huge database, and I have to get a list of all tables used for 100+ procedures. So far I’ve been able to get a query that returns all the tables that the procedure is getting data from, but no all the tables that are referenced. For example: Using that query if the procedure looks…
Oracle SQL select characters after numeric portion of a string
I have the string “Serenity Lane – Barbur Boulevard 10920 SW Barbur Blvd Portland, OR 97219” and I want to select the first 13 characters from it :10920 SW Barb Is there a way to select only the first 13 characters after the first numeric character? In this example, the first thirteen charac…