Questions tagged [coalesce]
COALESCE is a SQL function that returns the first non-NULL expression among its arguments. COALESCE() is ANSI standard and may be used instead of vendor-specific alternatives such as ISNULL(), NVL() or IFNULL().
coalesce
944
questions
4
votes
0
answers
23
views
Postgres NULL on composite types [duplicate]
To get to the point - i understand why these are true
select (null, null) is null;
select null is null as null_is_null;
I also understand why these are all false, resp. return null
select (null, null)...
0
votes
0
answers
27
views
Replace NA values with values from cells on the right in R
I have a data frame with sets of NA values between data, like this:
first.row <- c("2015-01-21","negative","negative","positive","2015-02-27","...
0
votes
0
answers
60
views
Looker Studio - Join after mimicking Union. Data conventions
Three tables:
Sale (id, Product.sku, quantity, price, total) PK = id, FK = Product.sku
Supply (id, Product.sku, quantity, value, total) PK = id, FK = Product.sku
Product (sku, name) PK = sku
Sale ...
3
votes
2
answers
70
views
R: join values, not variables?
I have 5 versions of the same dataset i.e., all version have the same columns and rows, with the same names. However, they contain values for different cells so that only if I could combine all of ...
1
vote
2
answers
59
views
How do I merge and coalesce several dataframes in R?
I have several datasets that are the results of long to wide transformations. Example data:
data1 <- data.frame(
x1 = c(1, NA, NA, NA, NA, NA), # Create example data ...
0
votes
1
answer
113
views
COALESCE function in SQL Server returns NULL although one argument isn't NULL
I have a list of employees working in different departments.
create table emp
(
emp_name varchar(15) primary key,
birthdate date not null,
dept_id integer not null
)...
0
votes
1
answer
146
views
COALESCE not work with empty list in Spring JPA Query
I am writing a RESTful API including three entities.
Category:
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "Category")
public class Category {
@Id
@...
0
votes
0
answers
47
views
Lag values of rows of a column on rows of another column
Please can anyone help me navigate through this logic, I have tried using the lag function, but it doesn't correctly with my window.partition("component').Orderby("x"). Thanks!
...
1
vote
1
answer
46
views
How to coalesce multiple columns in a list of several dataframes based on part of the variable names?
I have a long list of data frames where in each dataframe, there are some columns that need to be coalesced based on the name. That is, the values in the columns including Duo: should replace the ...
0
votes
0
answers
13
views
I know I need to use the null-coalescing assignment operator but can't figure out how to apply it to this statememt
Here is what I am trying to Coalesce "while ((line = reader.ReadLine()) != null)" and I have tried many things and finally had to admit, it is difficult because I really don't fully ...
0
votes
2
answers
52
views
Getting syntax error on CAST & COALESCE function
SELECT
CAST(purchase_price AS FLOAT64)
FROM
'peppy-generator-406617.customer_data.customer_purchase'
ORDER BY
CAST(purchase_price AS FLOAT64) DESC
I tried to get the purchase price in ...
0
votes
1
answer
94
views
How to use fill function from tidyr R package with groups
This question is a follow up to my other question, How to get tidy fill function to use groups when filling data rows.
I want to get one row per TIMESTAMP value. I want to fill in real data, by ...
-1
votes
2
answers
286
views
coalesce vs. concat functions with NULL values
This is my table:
enter image description here
in my table i should use
SELECT
Title+' '+FirstName+' '+MiddleName+' '+LastName as FullName
from employees
Where BusinessEntityID IN (1,2,4)
But as a ...
0
votes
1
answer
62
views
Filling in missing fields in a SQL query
I am trying to combine data from two tables Budget and Actuals into a simple table I can use in a PivotTable in Google Looker Studio to compare actuals and budgeted. I manage to combine the tables and ...
3
votes
2
answers
125
views
Coalesce inside an across statement using column name and a prefix
Again I feel like I should be able to do something to seems not quite complicated but I can't figure it out.
I have a dataframe df with variables a1, v_a1, a2, v_a2 and so on. All I want to do is ...