Comments on: Tag Cloud analysis in SQL and PL/SQL – Using Collections, Table Operator, Multiset and Collect operator https://technology.amis.nl/2009/03/06/tag-cloud-analysis-in-sql-and-plsql-using-collections-table-operator-multiset-and-collect-operator/ Friends of Oracle and Java Wed, 24 Jun 2015 09:59:44 +0000 hourly 1 http://wordpress.org/?v=4.2.2 By: Anton Scheffer https://technology.amis.nl/2009/03/06/tag-cloud-analysis-in-sql-and-plsql-using-collections-table-operator-multiset-and-collect-operator/#comment-5718 Sun, 15 Mar 2009 21:48:06 +0000 http://technology.amis.nl/blog/?p=4947#comment-5718 There are more useful collection conditions. For instance where you use
select ename
from emp
where 0 = ( select count(*)
from table(tags_tbl_type(‘discount’,’sales’) MULTISET EXCEPT csv_string( emp.tags) ));
you can also use
select ename
from emp
where tags_tbl_type(‘discount’,’sales’) submultiset csv_string( emp.tags);
And there’s also the cardinality function which you can use instead of “select count(*) from table( …. )

]]>
By: Lucas Jellema https://technology.amis.nl/2009/03/06/tag-cloud-analysis-in-sql-and-plsql-using-collections-table-operator-multiset-and-collect-operator/#comment-5717 Sat, 07 Mar 2009 07:14:18 +0000 http://technology.amis.nl/blog/?p=4947#comment-5717 Anton,
Thanks! That member of had escaped my notice. That is quite useful. You are right that the first query is much more compact too.

groeten, Lucas

]]>
By: Anton Scheffer https://technology.amis.nl/2009/03/06/tag-cloud-analysis-in-sql-and-plsql-using-collections-table-operator-multiset-and-collect-operator/#comment-5716 Fri, 06 Mar 2009 20:00:23 +0000 http://technology.amis.nl/blog/?p=4947#comment-5716 I have some more tag queries, to make your queries a little shorter

select column_value, count(*)
from emp
, table( csv_string( emp.tags ) )
group by column_value
order by 2;

select ename
from emp
where ‘discount’ member of csv_string( emp.tags );

]]>