I have a table with timestamp that I want to round off at 15 min. interval. I can round off using the below Query but it rounds off both 11:58 and 12:02 to 12:00 which is not what I want. I would like …
Tag: sql
a query from SQL/92 doesn’t work in later versions
I have a sql query like this: select tt.product_name, tt.countt from (select ofr.product_name as product_name, count(*) as countt from offers ofr group by ofr.product_name) as tt where 12 = (select …
How can i query to get to this result?
id string id2 1 a 1 2 b 1 3 a 2 4 c 2 5 d 3 Ok, so i can get SELECT * FROM table WHERE string NOT IN (‘a’,’c’): 2 …
Return matched-pair and the non-matched pair for each ID only once
Any help would be appreciated. I have two sample tables here. Table A: ID |Name 123|REG 123|ERT 124|REG 124|ACR Table B ID |Name 123|REG 123|WWW 124|REG 124|ADR Here is the simple join output …
Toad Notation – What do (Ix#)’s mean?
So, I’m trying to visualize a database, and I have some tables put together which consist of a mix of object-oriented and relational; just trying to tie them together. My issue is, I can’t seem to …
Select data from date range in DB2 SQL
I have a trouble trying get a data in DB2 SQL. I have a table Name StProdMoves and it holds data like this ProdName | Status | Brand | Type | Date(Numeric) ———-+———+——-+——-+—–…
Group By Error In MySQL with sql_mode=only_full_group_by
Tring the following query but i get; Error Code: 1055. Expression #3 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘PDC.PLG.LogDateTime’ which is not functionally …
How to update attribute based on result of aggregate function
I am new to mySQL. I want to update the order price of a table, based on the value of the retail price and the quantity of the product ordered. I have the following tables (simplified for this …
Having an issue with a stored procedure SQL-Server
I’ve got a stored procedure that i’m having some issues with. I’m trying to lookup against my table GOTWVotes and if VotedBy hasn’t voted before write the vote to the table(this is working) however …
How to split a column in two columns
I have an issue with a table called “movies”. I found the date and the movie title are both in the title column. As shown in the picture: I don’t know how to deal with this kind of issues. So, I …