For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!
Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.
Hi all,
I need to generate Barcode for products, print barcode, display barcode into reports and read data from barcode scanner to retrive a product.
Is there a plugin, a pl/sql package or APEX example to help me, please?
Thank you,
Sergio
select id,greatest(date1,date2,date3....) closed_date from YOUR_TABLE
Try this..
select id,greatest(nvl(date1,sysdate-36500), nvl(date2,sysdate-36500), nvl(date3,sysdate-36500)....) closed_date from YOUR_TABLE
so use the NVL on each column. and set it to something ridiculous, so it will always be less than the other values. and then, if the ridiculous value shows up, it means all the columns were null for that row.
Rather than relying on some rediculously small date use coalecse on each date column with the date column of intereste listed first. The order of the remaining terms in the coalesce statement is unimportant. e.g. on a table with three date columsn:
with x as ( select 1 id, sysdate dte1, sysdate-1 dte2, sysdate+1 dte3 from dual union select 2, sysdate, null, null from dual union select 3, null, sysdate-1, null from dual union select 4, null, sysdate-1, sysdate+1 from dual union select 5, null, null, null from dual ) select id, greatest( coalesce(dte1,dte2,dte3), coalesce(dte2,dte3,dte1), coalesce(dte3,dte1,dte2)) Max_Date from x ID MAX_DATE ---------------------- ------------------------- 1 09-OCT-2007 12.15.44 2 08-OCT-2007 12.15.44 3 07-OCT-2007 12.15.44 4 09-OCT-2007 12.15.44 5 (null) 5 rows selecte
This way if they are all null, you get a null result, and don't need to handle your null value date as a special case. It also avoids the situation where the unlikely event occurs where your special null value date appears as actual data.