I have the following table Data Data1 Data2 YTD ————————- 1 2 3 2 3 4 3 3 6 In the YTD column I have to average the rows data. I can …
get the values mit highets value sql
the following table is given (in Oracle); LVL KID FATHER 1 POD001 DPR001 1 POD002 DPR002 1 POD003 POD002 2 POD003 DPR002 2 POD004 DPR001 1 POD004 POD001 2 POD005 POD002 …
Redshift – CASE statement checking column EXISTS or no
I am querying dynamically tables where some of the tables might not have specific column. My intention is check the existence of the column and dynamically assign a value. Basically if all the tables …
Convert string to a date in db2
Ok I was able to get it fixed. I want to convert the string “10-Feb-2019 11:20” to “DD-mm-yyyy hh24:mi:ss”. I tried to date but it wasn’t working. I saw on other threads that the translate function …
Descending not working in query, but it should work? [closed]
I am making a scoreboard for my internship, for the games we play in the break. I have a really big query to get the results of all games and count the total of wins by players. SELECT winner, SUM(…
How can I solve this & reach better performance
We are using an ERP system, here is one sql query below – and it’s working: (it’s using an old syntax) (select last_name||’ ‘||name||’ ‘||to_char(datum_p,’DD.MM.YYYY’) from ( select co….
Pymysql DictCursor returning list rather than dictionary
I am trying to figure out why this query is returning a list of lists rather than a list of dictionaries. I suspect it has something to do with either the join or the ‘as’ portion of the query. Any …
How can I get data using if else in laravel elequent
Suppose I have a Salary model contains column of month and year I want to fetch data like Salary::where((year==date(‘Y’) && month<date('m')) || yearget() How can I …
SQL combining the join result of two different tables
I am having a problem with SQL at the moment. I use an example database of W3School This is what I have now: SELECT Categories.CategoryID, Categories.CategoryName, COUNT(Products….
Insanely poor query performance on SQL Azure
We have S1: 20 DTU 250GB SQL Azure database with following table CREATE TABLE [dbo].[Reads] ( [ReadId] [INT] IDENTITY(1,1) NOT NULL, [LicenseNumber] [VARCHAR](50) NULL, [Name] [VARCHAR](…