nvl Questions

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...
Bushcraft asked 30/8, 2011 at 6:33

2

Solved

As title, I'm writing some Stored Procedure on Oracle, first I checked the version SELECT * FROM v$version; with result Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Product...
Cowrie asked 22/7, 2019 at 2:30

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...
Mcinerney asked 1/7, 2014 at 3:4

8

Solved

Are there non obvious differences between NVL and Coalesce in Oracle? The obvious differences are that coalesce will return the first non null item in its parameter list whereas nvl only takes two...
Glossotomy asked 4/6, 2009 at 11:58

3

I have the following namedQuery select new test.entity.Emp(COALESCE(k.projectId,'N') as projectId, k.projectName) from Emp o inner join o.projects k However I am getting error expecting RIGH...
Regressive asked 17/12, 2014 at 15:25

1

I want to write the following query as a Hibernate Criteria query: select to_char(nvl(ol.updated_datetime, ol.created_datetime), 'dd/mm/yyyy'), sum(discount_price) from order_line ol where nv...
Surprisal asked 20/5, 2010 at 5:0

1

Solved

Sometimes I see an nvl() function in code. In the case of Java, it looks like this: public static String nvl(String value, String alternateValue) { if (value == null) return alternateValue; re...
Outlive asked 9/3, 2015 at 5:55

3

Solved

I have this table where NULL is the NULL value, not the string NULL: MYCOL -------- NULL example Why does this query not return the NULL row? select * from example_so where nvl(mycol, '') = '';...
Durative asked 9/10, 2014 at 9:20

3

I'm trying to run the following query: select a.*, case when NVL (SELECT max(b.field1) FROM b where b.field2 = a.tbl_a_PK , 'TRUE') = 'TRUE' then 'has no data in b' else 'has data in b' end...
Toinette asked 22/5, 2013 at 15:37

2

Solved

So I need to do a query where I need a bunch of NVL's but I need to do these in linq (if it helps the db backend is BD2 and we are using subsonic) I searched the web for "NVL linq" and didn't reall...
Melisandra asked 6/4, 2011 at 14:5

4

Solved

Does anyone know, why Oracle's NVL (and NVL2) function always evaluate the second parameter, even if the first parameter is not NULL? Simple test: CREATE FUNCTION nvl_test RETURN NUMBER AS BEGIN ...
Cystocarp asked 7/1, 2010 at 15:2
1

© 2022 - 2024 — McMap. All rights reserved.