I have to create a service availability using info from this 2 query. First Query. example result second query example result The formula as below ((Reporting Period – Unplanned Outage)/Reporting Period)*100 Answer Consider using conditional aggregation: The availability computation could probably be si…
Tag: sql
I get an error “Error converting data type nvarchar to real.”
The code which I have is below, can you please inform me where the issue might be so we can drop the price by warehouse ID with 7%? Answer As you are not assigning any value to @Price in the C# code while your Warehouse Id and the Discount rate are subject to be assigned by the end-user, I recommend
Which cars have been rented together how many times? Which one is more easy to do MySQL or python?
I have a project about github but I represent like rent a car db for better understanding. I must find which cars have been rented together how many times from db. I have a 2 table: rent and car. I want to like this type of return I tried some queries to find this but I can’t. Also, I think
Get only list of user with latest update by days
I am struggling to write a query to display list of users that check-in in a day, but if the same user check-in twice or more, it would take the latest in a day. For example user A check-in in the morning, then check-in again in the evening, then the system will display only his latest check-in in the list
The SUM() is counting all the values, instead of the ones that meet the condition
I have following query to write: Knowing that a team will earn at least the market value (WartoscRynkowa) of a given player from the sale of a player and knowing the amount of his transfer (KwotaTransferu), calculate how much the team will earn or lose by selling players with the highest chance of transfer (&…
Can’t Insert into seperate column while using two select statements
TABLE: NAME : Jance C hiatt, Sam, Brook, Newyork, London ADDRESS : NULL,NULL,NULL,NULL NewYork and London should be address column but it is showing on Name itself Here address is not coming at the separate column of database. Kindly tell me what issue I am facing Answer Each insert statement creates new rows…
Return in which or statement results are from SQL [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 1 year ago. Improve this question I’m having the following SQL statement, to return worksheets that teachers have liked, …
Combine two different rows in single table using same table in SQL Server
Consider a database table holding data like that: Id UserId IsCheckIn DateTime Image AccountId 30356 60866 1 2020-12-19 12:17:17 b622f3e0806f.jpg 10017 30355 60866 0 2020-12-19 10:52:26 b622f3e0806f.jpg 10017 30354 60866 1 2020-12-19 10:51:02 b622f3e0806f.jpg 10017 30353 60866 0 2020-01-20 09:29:42 1596.jpg 1…
MySQL convert timestamp and time string to DateTime format
In my table have two columns, one as timestamp to save the date and one as time string to save the time with period. Eg: I want to combine them into one column as DateTime format in the result then order by desc on that column. Here is the example: http://sqlfiddle.com/#!9/25eb21/4 The column name ‘Date…
Subtract today’s date with date column in SQL [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 1 year ago. Improve this question I have a column in SQL item_expired, this column stores data in the form of dates from other …