I found something weird while executing query today and i want to know how this happens. Below is my query: this query takes 2-5 seconds while searching for the data. Now i did small change in the query as follow: In this case query takes 2-3 minutes. Here testing_date column data in dateTime format for examp…
Select ans specific value or, if not exists, the minimum one
I’m stuck trying to solve a problem using SQL (MySQL 5.6). Need to get the address which has ID 2 or, if not exists ID 2, the lower ID. For example If a costumerID have an AddressID 2, must get that. If not, must get the minimum AddressID. The output must be like: So far I’ve tried this: but get
ORACLE – Using left join and inner join to edit a query
I am studying this query and I am trying, but I am not able to return all ships regardless of the sector of the user and the sector of the ship. (line 5) The query as it is, returns all ships that …
Add a Unique ID Number To Duplicate Rows SQL
I have the below table called TestTable and need to update the MsgNum column to have a unique number ordered by the date column but grouped by the JobNum. JobNum | MsgNum | Date 320 | 0 | …
pyodbc/sql – Newly created tables are going to Master database and not specified database
I am working on a project for class, where I am using Python to create a database and tables in my 2016 SQL Server. I have installed pyodbc and was able to establish a connection between Python and …
Group By and Groups of Groups in MS Access
I am trying to write a query in MS Access using group by that results in the count of two groups and then the count of the remaining groups combined. So if I have a field color and 18 items and I do …
How to group and order rows with different date values in SQL
I have a result like this: Query is pretty simple: I need to group them, get sum of amount and order by date. Notice that date values are not the same. I can’t group results because of this. Important thing is i need to order by Date column. This is the result i want: I’m trying this code but sql
Best way to represent NULL in a column that represents a type [closed]
Given a table with a column that represents a type A or B or None, how should the None be represented? As a NULL or explicitly None or something else?
Query build to find records where all of a series of records have a value
Let me explain a little bit about what I am trying to do because I dont even know the vocab to use to ask. I have an Access 2016 database that records staff QA data. When a staff member misses a QA we assign a job aid that explains the process and they can optionally send back a worksheet showing
Postgres converting double double precision to text creates ‘1.50000000000’
Working with postgres and I need to convert total minutes into the format of 1h 1m. I’m doing this via the following code replace( (119 / 60 + (119 % 60) / 100.0)::text, ‘.’, ‘h ‘ ) + …