I have a database for logging peeing/pooing time for a puppy. Each row contains a timestamp datetime, and bools pee and poo. I’m trying to add a column for the time since last pee/poo. The verbose version of this column would be: subtract this row’s datetime from datetime of the row with the highest datetime that is lower than this
Tag: database
Just wondering how can i convert this below query to a oracle query using merge statement?
Answer With what you posted so far, could be something like this (presuming that last line’s IN_WFID represents some kind of a parameter):
Create database transaction and commit/rollback later [closed]
Can we create database transaction and commit/rollback later. I mean we do not committing/rollback at the same machine/host/server. Let say we return the transaction and let other to decide to commit …
Need to fetch all users that logged in user is following as an objects
I am building handmade MVC framework, and I want to implement following system (Like Twitter) so User that is signed in can follow another user and when that signed in user visits his profile he can see all other users that he is following and vice versa. I am not sure which query to apply in order to fetch all
UPDATE and SET column row values by calculating values from antoher table
I have two tables: products – which has UnitsSold(total/cumulative amount of sold products/item), and sales – which has SoldQuantity (how many units sold per transaction) The same unit could be sold many times, so we need to calculate how many times it sold from sales table which have SoldQuantity and show the result in UnitsSold, which will show how many
Giving a specific number to fields in my Db
I want to give specific unique numbers to the following field in my db. The column looks like: August 2020 August 2020 August 2020 August 2020 September 2020 September 2020 September 2020 October 2020 …
Microsoft Access 2016 – Need to combine SQL query using JOIN …. ON Col1 MOST LIKE Col2
I am working in Microsoft Access 2016. I have a data table [Data] that contains many thousand rows of data. I have a lookup table [Lookup] that contains all of the project IDs that are known. These tables should combine on the project ID, which is a string field. Normally, I would join these tables using: The issue is that
Oracle SQL count same field across multiple tables
I have an oracle database that has the same name field in multiple tables. It kind of looks like this: The common field in each table can either be ‘yes’, ‘no’, or null. I’m trying to get the value counts of all the fields in one query, but I can’t figure it out. Basically I want this: I have this
How to check if a given database exists on the server?
I am doing a union of same table from different databases to get all the company details. Something like below. This is working fine and I am getting all company details, but I want to make sure that database is exist in the server. Because if any one of the union database is not exist in the server then the
Have I normalized this database to a 3NF level the right way? [closed]
I had a lecture at college recently about normalizing databases, but since we are online I can’t really ask a lot of questions, so here I am. Can someone tell me if I’m doing the conversion right, if …