coalesce Questions
14
Solved
I need to fill a cell with the first non-empty entry in a set of columns (from left to right) in the same row - similar to coalesce() in SQL.
In the following example sheet
---------------------...
5
Solved
A little help here. I really don't understand how to use this coalesce in MySQL
I have read all the pages in page 1 result of how to use coalsece in google result.
I know its meaning that it ret...
14
Solved
Is there a Java equivalent of SQL's COALESCE function? That is, is there any way to return the first non-null value of several variables?
e.g.
Double a = null;
Double b = 4.4;
Double c = null;
...
2
Solved
I have a PySpark Dataframe with an A field, few B fields that dependent on A (A->B) and C fields that I want to aggregate per each A. For example:
A | B | C
----------
A | 1 | 6
A | 1 | 7
B | 2...
Dispend asked 25/2, 2018 at 12:49
5
Solved
I have a query inside a stored procedure that sums some values inside a table:
SELECT SUM(columnA) FROM my_table WHERE columnB = 1 INTO res;
After this select I subtract res value with an intege...
Theodicy asked 24/7, 2013 at 16:1
9
Solved
Background
Several SQL languages (I mostly use postgreSQL) have a function called coalesce which returns the first non null column element for each row. This can be very efficient to use when tabl...
2
Solved
I've got a dataframe like this one:
stage1 stage2 stage3 stage4
a NA b c
NA d NA e
NA NA f g
NA NA NA h
Where each column is a stage from a process. What I want to do is to coalesce each column ba...
9
Solved
I have two string columns a and b in a table foo.
select a, b from foo returns values a and b. However, concatenation of a and b does not work. I tried :
select a || b from foo
and
select a||'...
Economy asked 13/11, 2013 at 0:24
2
Solved
I'm selecting the max of a column from a table. But there is one problem: if there are no rows in the table, it returns null.
I want to use a function which will return a certain value if the res...
7
Solved
12
Solved
Something I find myself doing more and more is checking a string for empty (as in "" or null) and a conditional operator.
A current example:
s.SiteNumber.IsNullOrEmpty() ? "No Number" : s.SiteNum...
Pow asked 10/3, 2010 at 20:1
7
Solved
I know this is a duplicate Q but I can't seem to find the post again
Using the following data
df <- data.frame(A=c(1,1,2,2),B=c(NA,2,NA,4),C=c(3,NA,NA,5),D=c(NA,2,3,NA),E=c(5,NA,NA,4))
A B C...
2
Solved
I have the following command:
kubectl get pod -A -o=json | jq -r '.items[]|select(any( .status.containerStatuses[]; .state.waiting or .state.terminated))|[.metadata.namespace, .metadata.name]|@csv...
6
Solved
I want to use dplyr::coalesce to find the first non-missing value between pairs of variables in a dataframe containing multiple pairs of variable. The goal is to create a new dataframe with now onl...
7
Solved
I'm tempted to lie and say that English is my second language, but the truth is that I just have no idea what 'Coalescing' means. I know what ?? 'does' in C#, but the name doesn't make sense to me....
Lyontine asked 20/4, 2009 at 21:31
11
Solved
What is best way to check if value is null or empty string in Postgres sql statements?
Value can be long expression so it is preferable that it is written only once in check.
Currently I'm using:...
Carton asked 20/5, 2014 at 17:13
4
Solved
I have two fields that I'm comparing with MySQL's function COALESCE(). For example, COALESCE(Field1, Field2). The problem is, Field1 is sometimes blank but not null; since it's not null COALESCE() ...
1
I have a table named table1 with columns Gender varchar(10) and Team numeric.
create table table1 (
ID integer
Gender varchar(10),
Team numeric
);
insert into table1 (ID,Gender,Team) values
(1,'M...
Obscure asked 2/6, 2020 at 17:20
8
I have a number of functions:
String first(){}
String second(){}
...
String default(){}
Each can return a null value, except the default. each function can take different parameters. For example...
Sharitasharity asked 7/4, 2017 at 14:7
3
I am using MS SSIS 2008 and I want to perform COALESCE function in DERIVED COLUMN function.
Could you help me how to write the expression?
7
Solved
What is the best way to include an input param in the WHERE clause but exclude it if it is null?
There are a number of ways I believe, but I can't seem to remember then.
Also could I use the COAL...
Clermontferrand asked 19/11, 2010 at 12:32
3
Solved
Good morning my beloved sql wizards and sorcerers,
I am wanting to substitute on 3 columns of data across 3 tables. Currently I am using the NVL function, however that is restricted to two columns...
3
Solved
I have a table like this:
CUSTOMERS_ID DATE_SALES DIMENSION
MARIO1 20200201 NULL
MARIO1 20200113 Spain
MARIO2 20200131 NULL
MARIO3 20200101 France
MARIO3 20191231 Spain
and I need to order by CU...
Objurgate asked 29/5, 2020 at 6:48
5
Solved
I want to do something like this:
public override int CompareTo (Foo rhs)
{
return Bar.CompareTo(rhs.Bar) ??
Baz.CompareTo(rhs.Baz) ??
Fuz.CompareTo(rhs.Fuz) ?? 0;
}
This doesn't work as writ...
6
Solved
In advance, I would like to say thanks for the help. This is a great community and I've found many programming answers here.
I have a table with multiple columns, 5 of which contain dates or null....
1 Next >
© 2022 - 2025 — McMap. All rights reserved.