Originally posted by marist89
Or, you can try
select count(*) from (select distinct company, time, region from test) t
YES. Much more elegant solution. Although there is one more sort operation here, there is no implicit datatype conversion which might result in better performance.

Also there is one more catch with uday's suggestion, which one must be avare of. TIME is obviously a DATE datatype. As there is no explicit conversion in uday's suggestion, Oracle performs implicit TO_CHAR conversion on date column. As default NLS_DATE_FORMAT *typicaly* contains only the date portion without the time component, the implicit date-to-char conversion will probably truncate the time portion, so you might actually get much less distinct rows as there realy are with "concatenation approach". If you go with this "distrinct concatenation" you'd better use explicit TO_CHAR date conversion with appropriate format mask.