mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
Merge branch 'master' of github.com:qgis/Quantum-GIS
This commit is contained in:
commit
4d630b7d79
19
resources/function_help/coalesce-en_US
Normal file
19
resources/function_help/coalesce-en_US
Normal file
@ -0,0 +1,19 @@
|
||||
<h3>coalesce() function</h3>
|
||||
Returns the first non-NULL value from the expression list.
|
||||
<br>
|
||||
This function can take any number of arguments.
|
||||
<h4>Syntax</h4>
|
||||
<code>coalesce(expression1, expression2 ...)</code><br>
|
||||
|
||||
<h4>Arguments</h4>
|
||||
<code>expression</code> - any valid expression or value, irregardless of type.
|
||||
<br>
|
||||
|
||||
<h4>Example</h4>
|
||||
<!-- Show example of function.-->
|
||||
<code>coalesce(NULL, 2) → 2</code><br>
|
||||
<code>coalesce(NULL, 2, 3) → 2</code><br>
|
||||
<code>coalesce(7, NULL, 3*2) → 7</code><br><br>
|
||||
<code>coalesce("fieldA", "fallbackField", 'ERROR') → value of fieldA if it is non-NULL
|
||||
else the value of "fallbackField" or the string 'ERROR' if both are NULL</code><br>
|
||||
|
@ -92,6 +92,9 @@ TARGET_LINK_LIBRARIES(qgis.g.info
|
||||
${GRASS_LIBRARY_gproj}
|
||||
${GDAL_LIBRARY}
|
||||
)
|
||||
IF (UNIX)
|
||||
TARGET_LINK_LIBRARIES(qgis.g.info m)
|
||||
ENDIF (UNIX)
|
||||
|
||||
########################################################
|
||||
# Install
|
||||
|
@ -295,6 +295,9 @@ class TestQgsExpression: public QObject
|
||||
QTest::newRow( "condition else" ) << "case when 1=0 then 'bad' else 678 end" << false << QVariant( 678 );
|
||||
QTest::newRow( "condition null" ) << "case when length(123)=0 then 111 end" << false << QVariant();
|
||||
QTest::newRow( "condition 2 when" ) << "case when 2>3 then 23 when 3>2 then 32 else 0 end" << false << QVariant( 32 );
|
||||
QTest::newRow( "coalesce null" ) << "coalesce(NULL)" << false << QVariant( );
|
||||
QTest::newRow( "coalesce mid-null" ) << "coalesce(1, NULL, 3)" << false << QVariant( 1 );
|
||||
QTest::newRow( "coalesce exp" ) << "coalesce(NULL, 1+1)" << false << QVariant( 2 );
|
||||
|
||||
// Datetime functions
|
||||
QTest::newRow( "to date" ) << "todate('2012-06-28')" << false << QVariant( QDate( 2012, 6, 28 ) );
|
||||
|
Loading…
x
Reference in New Issue
Block a user