I'm trying to implement something like the 'group by' behaviour of the parametric search interface, it works fine for data of type STRING, but I'm still confused about how the SET datatype works because i don't get the expected results :
I have trouble with results from the following SQL statement when the field is of type SET (Vortex or tsql) :
SELECT U_Publisher AS val, count(*) AS cnt FROM html GROUP BY U_Publisher
Given the following record set :
E:\Temp>tsql -d D:\texis\data1/PortalLiferayS\db1 "SELECT U_Publisher AS val FROM html WHERE U_Publisher LIKE 'pub4'"
Texis Version 05.01.1258488718(20091117) Copyright (c) 1988-2009 Thunderstone EPI
val
------------+
pub3,pub4,pub25,
pub1,pub4,
pub4,pub5,
Iwould expect either of the following results :
val cnt
------------+------------+
pub3,pub4,pub25, 1
pub1,pub4, 1
pub4,pub5, 1
or
val cnt
------------+------------+
pub1, 1
pub3, 1
pub4, 3
pub5, 1
pub25, 1
but i'm getting something like :
E:\Temp>tsql -d D:\texis\data1/PortalLiferayS\db1 "SELECT U_Publisher AS val, count(*) AS cnt FROM html WHERE U_Publisher LIKE 'pub4' GROUP BY U_Publisher"
val cnt
------------+------------+
pub1 1
pub4 1
pub3 1
pub4 1
pub25 1
pub3 1
pub4 1
pub25 1
pub1 1
pub4 2
pub5 1
pub4 1
pub5 1
pub3 1
pub4 1
pub25 1
or this with DISTINCT
E:\Temp>tsql -d D:\texis\data1/PortalLiferayS\db1 "SELECT DISTINCT U_Publisher AS val, count(*) AS cnt FROM html WHERE U_Publisher LIKE 'pub4' GROUP BY U_Publisher"
val cnt
------------+------------+
pub1 1
pub4 1
pub3 1
pub25 1
pub4 2
pub5 1
I have trouble with results from the following SQL statement when the field is of type SET (Vortex or tsql) :
SELECT U_Publisher AS val, count(*) AS cnt FROM html GROUP BY U_Publisher
Given the following record set :
E:\Temp>tsql -d D:\texis\data1/PortalLiferayS\db1 "SELECT U_Publisher AS val FROM html WHERE U_Publisher LIKE 'pub4'"
Texis Version 05.01.1258488718(20091117) Copyright (c) 1988-2009 Thunderstone EPI
val
------------+
pub3,pub4,pub25,
pub1,pub4,
pub4,pub5,
Iwould expect either of the following results :
val cnt
------------+------------+
pub3,pub4,pub25, 1
pub1,pub4, 1
pub4,pub5, 1
or
val cnt
------------+------------+
pub1, 1
pub3, 1
pub4, 3
pub5, 1
pub25, 1
but i'm getting something like :
E:\Temp>tsql -d D:\texis\data1/PortalLiferayS\db1 "SELECT U_Publisher AS val, count(*) AS cnt FROM html WHERE U_Publisher LIKE 'pub4' GROUP BY U_Publisher"
val cnt
------------+------------+
pub1 1
pub4 1
pub3 1
pub4 1
pub25 1
pub3 1
pub4 1
pub25 1
pub1 1
pub4 2
pub5 1
pub4 1
pub5 1
pub3 1
pub4 1
pub25 1
or this with DISTINCT
E:\Temp>tsql -d D:\texis\data1/PortalLiferayS\db1 "SELECT DISTINCT U_Publisher AS val, count(*) AS cnt FROM html WHERE U_Publisher LIKE 'pub4' GROUP BY U_Publisher"
val cnt
------------+------------+
pub1 1
pub4 1
pub3 1
pub25 1
pub4 2
pub5 1