7/22/2013 1 Comment SQL RANK() function Example SELECT p.version, p.launch_date
RANK() OVER (PARTITION BY p.version ORDER BY p.launch_date DESC) "Rank" FROM product p WHERE p.id = '1234'
1 Comment
7/22/2013 0 Comments SQL: Select the minimum and maximum values of a column grouped by another column for a given where clause.select p.version, min (p.launch_date) as first, max(v.launch_date) as last
from product p where p.id = '1234' group by p.version, p.id order by p.version The above query selects the first and last launch dates for every version (major version number assumed) of a given product with id 1234 7/12/2013 1 Comment How to stop JiBX from marshalling empty nodes for null fields on structure mappingUse a test-method on the structure to return false if the field value is null.
Note: This can be applied only when the usage attribute is set to optional (ie. usage="optional") E.g. <structure name="CreditCard" field="creditCard" usage="optional" test-method="hasValidCredtiCard"> <value name="CardNumber" field="number" usage="optional"/> <value name="ValidThru" get-method="getValidThru" set-method="setValidThru" usage="optional"/> <value name="NameOnCard" field="name" usage="optional"/> .... </structure> |