Similar question here Very similar to the question above but with a slight difference, I need to find a list of users that haven’t seen at least one film in a list of movies. Assuming two tables ‘…
Tag: sql
Hive Case Resulting Duplicate Row
I have a table containing contact numbers and another reference table containing a “length” variable and a number column. What I need is to find the prefix name where the prefix of the number matches …
Mysql: GROUP BY custom date interval
Situation : a table where every minute X energy device saves its consumption. I have to calculate the daily consumption (at hourly intervals, 00 – 01 – 02 – 03 – 04 ….. 23) of a single device on a …
select every 100 lines, one line SQL request? [closed]
I have a table that contains 50000 lines for example. I need to select 50 lines from table that contains this 50000 lines, so I need to select every 1000 lines, one line. for example divide 50000/50, …
Update SQL rows from another table and a static value
I’m attempting to create rows in a temporary table using values from another table as well as static values. The best I could come up with is this snipped of code, using multiple queries. I’m curious …
SQL error when inserting a function variable
I try to use a value resulted from a 1st function as argument into a 2nd function, but SQL give me the error cannot be NULL Erreur de la base de donnĂ©es WordPress : [Column ‘option_price’ cannot be …
Find unmatched rows between two tables
Given this setup: CREATE TABLE table1 (column1 text, column2 text); CREATE TABLE table2 (column1 text, column2 text); INSERT INTO table1 VALUES (‘A’, ‘A’) , (‘B’, ‘N’) , (‘C’, ‘C’) , (‘B’, ‘A’)…
How to use variables in SQL in an Azure stored procedure
I need have a stored procedure that runs once per day, doing some metric calculations on data collected that day. I’m going to get a datetime that is equivalent to the last time the procedure was run (…
How to update an integer value in an SQL record?
I’m pretty new to SQL and the Sqlite3 module and I want to edit the timestamps of all the records in my DB randomly. import sqlite3 from time import time import random conn = sqlite3.connect(‘…
Based on the value in one column change the value in another column across group
I am new to SQL Server. I have a table: Group id DEPT marks ————————————– A 001 CS P A 002 ECE P A …