I am having a problem with updating a NULL value in SQLI. There are no errors but it just stays at null. I am trying to get every NULL value in the optional_security_question and turn it into Not Available instead. Answer Try to use this syntax:
Tag: sql
Use SQL to ensure I have data for each day of a certain time period
I’m looking to only select one data point from each date in my report. I want to ensure each day is accounted for and has at least one row of information, as we had to do a few different things to move a large data file into our data warehouse (import one large Google Sheet for some data, use Python
I need to group by year and month from a timestamp structured as yyyyMMddHHmmss 20170227141500
I need to group by year and month from a timestamp, structured as yyyyMMddHHmmss 20170227141500 (Google’s bigquery gkg table). I need to count the year monthly records. Data type is integer. timestamp is the column name. In fact, I need to gruop by first 6 digits of the timestamp. yearmonth is my group …
LINQ equivalent of this subselect
“Tasks” table: “Task History” table: Sql query: Which tasks were completed in the last 30 days? Q: What is the equivalent LINQ expression for this SQL query? Answer This query should do what yo want:
mysql Duplicate entry error for primary key with similar values
This is how i created my table, i have composite key columns. now, im trying to insert this two values that are the same except for the last character ‘t’: value1 = testbtc:testusd value2 = testbtc:testusdt output error: it just makes no sense, they are not duplicated, is something missing on my t…
Select last N rows that match C condition (PostgreSQL)
I have a table such as i.id t.status 140 ‘DONE’ 140 ‘RUNNING’ 140 ‘READY’ 137 ‘FAILED’ 137 ‘DONE’ 137 ‘DONE’ 123 ‘DONE’ 123 ‘DONE’ Which is a result of this query: I want to somehow get the id 137, because it’…
SQL Exit scalar function prematurely
In SQL, you can exit the stored procedure prematurely with RETURN statement. However, when I try to apply the same principle to the scalar function, it returns the error, since function needs to return something. How do I prematurely exit the scalar function the same way RETURN is used in the stored procedure…
SQL an ID in one group and an id from another
I have a request where I need a count where a participant completed an activity under one id (the gateway to completing other things) and then an id in a list of other ids. Right now, this code is only coming back with the the a count of the one id but not saying that one id complete + the
For rows with the same A, B, C values, how to select only “earliest” row (specified by column D) within a given time range?
I currently have a query (simplified below): Basically, the data source we’ve been getting data from writes their timestamps as when their job finished running rather than when the data actually came in (we can’t do anything about this on our end). Their jobs regularly end at 5-6 minutes after the…
ID which is available in table1 but not available in table2, check it date wise [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed last year. Improve this question Questio…