Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 8 months ago. Improve this question So im planning to develop a test SaaS software for a hobby project, …
Tag: sql
Write a SQL query with a subquery in .NET Core using Entity Framework that returns a list of items with varying number of returned child rows
I have this test SqlFiddle: http://sqlfiddle.com/#!18/05fce/1 The idea is that for each product (table webspiderproduct) it will return the lowest price from each shopId from the table webspiderproductprice. So the returned data should look like this: I am using SQL Server. In pseudocode should I write a and …
How to insert values for the current session user using $stmt = $connect->prepare
This is my current code for adding some additional information to a database table named klantinfo. This information is added after the user is logged in. At the login, the given username gets inserted into the login table, but also into the klantinfo table. This way I can compare the username in the database…
Postgresql merge columns
I have a main table which is like this I can merge full_name and last_name like this but I couldn’t do the same thing with the children_names column I want to select children like this but I want to add last_name filed at the end of each child like this Answer Using a scalar subquery: Yet it would be mu…
Trim Intermediate spaces in a string in Postgres
In the result, want only intermediate spaces to be removed. Need to print only first part before hypen (-) along with Percentages. Can you please help. Input String: AMAZON – 25%; SAP – XXXXX – 45%; MICROSOFT – XXX&YYY – 30% Query: Answer regexp_split_to_table can be used to …
How to split linestrings into their individual segments?
I am new to PostGIS. I have a set of (thousands) of Linestrings and associated multiple points along the line. I want to divide each line into a set of line segments consisting of only 2 points. I find a few answers, But none of the answers I want. for example https://gis.stackexchange.com/questions/21648/exp…
“Buy Items” with SQL Transaction in EF Core, if user send many requests, items are bought even if they can’t afford it
I’m trying to make a game where the user can buy items with ingame coins. The coins and the items are stored in a SQL database, and user should (obviously) only be able to buy items that they can afford. The Problem with this code is that if the user spams many requests at the same time, he gets more
SQL for Calclate sum of Sales At particular time every day
Order Table.Reprpesents Order Date and Created is time at which record was inserted The laltest record in this table is at(Created value) – 05:17:38.710 Output – 2021-12-26 05:17:38.710 At this time on 26th i.e. today’s date the sales was At the same time I want to know the sales on 25th I w…
Finding who called who
I have these two tables. Subscriber table contains SubscriberID and his Phone number. NetworkP2P contents SubscriberID, to who he has called AddresseeNumber and when the call started, ended. Example data: Subscriber NetworkP2P Not all Phone numbers match the ones that Subscribers have. How would I approach th…
How do I find data from this day exactly one year ago in oracle?
Merry Christmas, I am using the below query to get the prices, but my requirement is to get the data for last one year from trunc(sysdate). i have tried using DATEADD function but its gives me an error cast(p.asof as DATE) = cast(DATEADD(Year, -1, GETDATE()) as DATE) Can anyone please help, what all changes i…