Count of tokens using group by + SYN operator + Spell Checking + Stemming
Hi,
I have a text data on which i have created context index and populated the tokens table using "CTX_DOC.TOKENS" procedure.
Now i want to find the number of occurences of tokens using count and group by function.
I am using the foll query on table "INSP_INS_IDX_TOK"
select token ,count(token)
from INSP_INS_IDX_TOK
group by token
order By 2 desc
Token count(Token)
WORK 84
WORKING 24
TAKING 14
TAKE 13
now i want to use the synonym operator, stemming operator and spelling check to be implemented while finding the count of tokens so that, it would give more insights.
o/p should be like
Token count(Token)
WORK 108
TAKE 27
Please suggest me some inputs on the same.
Thanks in Advance.
put it in a table, create context index and then query....
--- As oracle text can be used.
On the different note, try to create a context index and look at the $I table of that index. You may find something relevant.
Similar Messages
-
Anyone using Jspell in Forms for spell checking?
I have this working in our application using the jspellintegration.pll code from OTN.
It is OK if the field to be checked is on the 'root' canvas, but not if the field is on a popup window (dialog window) canvas. I register the field in WNFI trigger as per code sample, but Form crashes when I set the dictionary type (jspell.setdictionarytype).
I have raised a TAR but been told that code samples from OTN are not supported!
Has anyone got jspell working on fields on a popup canvas?
Any help much appreciated!
Regards, Adrian.Adrian,
I don't know if this applies but I've had trouble getting the ImageButtonComplete PJC to work on popup canvases. This PJC puts an icon and text on a push button. We experience a crash when setting the icon for these PJC buttons on a popup canvas - works great normally.
We finally had to set the icon for this PJC in a timer. I know this is not a recommended course of action but everything else fails. I tried doing sleep loops of varying length but the timer was the only mechanism that didn't crash.
Try creating a timer (hope I'm insulting you with an example) where you have been doing your PJC set
declare
TM_ID TIMER;
begin
TM_ID:=CREATE_TIMER('ADRIAN_TIMER',1,NO_REPEAT);
end;
Then in a when-timer-expired trigger at the form level
if GET_APPLICATION_PROPERTY(TIMER_NAME)='ADRIAN_TIMER' then
do your PJC stuff
I'm certain it is superb advice to avoid timers but you might try just to see if it works.
Mick -
Using the match/merge operator
Hi guys,
I have created a simple table with 4 columns:
EMPLOYEES
- employee_id
- emp_firstname
- emp_lastname
- emp_telephone
I have placed 5 entries in the table:
11, jane, doe, 80980980
12, william, gates,6876876868
13, john, anderson, 545646546
14, michelle, millo, 340580334
15, john, anderson, 545646546
Row 13 and 15 are duplicates, except for the employee_id. I'm trying to use the match-merge operator to check for matches on emp_firstname, emp_lastname and emp_telephone. I would like to merge the rows matching on firstname, lastname and telephone number, and would like to keep the lowest employee_id as PK.
I have tried to use the match-merge operator with the following settings;
Input connections:
- employee_id
- emp_firstname
- emp_lastname
- emp_telephone
Merge output
- employee_id
- emp_firstname
- emp_lastname
- emp_telephone
Xref output
none
Match bins:
- emp_firstname
- emp_lastname
- emp_telephone
Match rules:
MA_0, all_match
Merge rules:
emp_firstname: all match
emp_lastname: all match
emp_telephone: all match
When I debug the match merge operator I get " 4 in, 4 out", but I expected to have "5 in, 4 out". Am I using this match/merge operator the right way?
thx for you help!
michiel
nullHi Robert,
I tried on 3 database installations (all 10.2). there is no parameter DB_BLOCK_BUFFERS set. And i do not assume that there is a reasn for increasing the db_cache_size - means: why i did not get any error for that presumed case?
btw: can you explain why i should increase db_cache_size?
thanks,
Andreas -
Use different language and Spell check
Hello, just got an iPad to supplement my two Android phones, and like it so far...
Except for one thing that drives me nuts...
The spell check. I live in Scandinavia, but like to use English as my interface language. This causes major problems, when I write something in Danish.
Is there any way to have English as the interface language, but use another language for spell checking?
Also, is there a way to use two different languages in spellcheck? Its really annoying to have English words pop up as suggestions when I write something in a different language and vice versa...From a user perspective this is wrong UX and lacks total support for multi-national companies, especially when the (national) keyboard layout differs from the (foreign) keyboard layout that is being forced to use if one wants the spell check to be performed in the foreign languge.
Let's take the following example. My language settings are set to English because I want my interface in English. The used keyboard layout is Flemish (=Dutch) (AZERTY). When writing emails the spell check is performed in Dutch since iOS uses the keyboard related language. This is fine as long as I write emails to people in Belgium which do read and speak Dutch. However when I want to write English emails (and hence would like English spell check) I am forced to switch my keyboard to English (UK). This is not really OK as switching the keyboard messes up the layout I am used to work with (English -> QWERTY).
Essentially, the selected keyboard (and keyboard layout for that matter) shouldn't have any impact on the used language for the spelling check. To be honest I can't remember of any application/OS used so far that applies this logic.
I really do hope that this gets fixed in some way (e.g. by adding the option to select the spelling check language) in a future update of iOS. -
Use spell check for German and English
Is it possible to use German and the English spell check but not switching 'languages feature' in system preferences all the time, for a Mac book with intel core 2 / 10.5.5?
Maybe putting an icon on the dock to use when an e-mail is typed in German and switch later again to English?
Manfredflowerpotter,
I don't know about Apple's Pages, but with Microsoft Word you can turn on spelling and grammar and it will work as you type. I find that useful for possibly correcting sentences/words at the end of a session.
Clinton -
May i know which tools used for spell check in iphone 4..?
Hi,
I want to know what kind of tools used in iphone 4 for spell check. It works fantastic while typing messages and it pop up related words automatically..I liked it very much..So, i want to know what kind of tools they used to achieve this..
Thanks..im pretty sure that it private information. Apple doesn't want other companies knowing their secrets.
-
How to spell check email using icloud on a PC
I am using a PC with internet explorer to view and compose email messages but do not see a way to spell check prior ro sending? Help?
Hello mpehrson,
If you are using a web browser to send iCloud emails, you can use the web browser's spell checking feature:
If you’re using iCloud Mail in Safari or Firefox on a Mac, you can check an iCloud email message for spelling errors using the browser’s spell-checking feature.
If you’re using a different web browser, check the browser’s preferences or menus to see if it has its own spell checker.
iCloud: Spell-check an email
http://support.apple.com/kb/PH2633
Thank you for using Apple Support Communities.
Best,
Sheila M. -
Mandatory fields while using Group chart of accounts
Hi,
Which are the mandatory fields while maintaining GL accounts in FS00 if i am using Group chart of accounts.
And how attached these group chart of accounts gl to the operational chart of account GL.
rajHi,
the assignment from operational chart of accounts to group chart of accounts is done in OB13. Follow the steps in Customizing IMG FIn. Acc. (new) / Consolidation preparation (new) / General specifications / G/L and FS Charts of accounts...
Best regards, Christian -
Using Groups in SharePoint from Active Directory
Hello,
Is it possible to use groups in SharePoint from AD?
I have several groups in AD that I would like to use in SP. Of course SP has its own set up groups in permission (Owner, Member and Visitor). I do not want to use these groups. What I would like to do is use groups that are in my AD and assign those the
designer, contributor, read-only..etc permission.
For example, SP people picker finds my AD group called "Finance_Project" and assign this group with permission rights as a contributor.
Is this doable in SharePoint. I would think since SharePoint can be authenticated with AD, you should be able to use your own AD groups.
Any suggestions, articles and answers are greatly appreciated.
artisticwebYou can do this in SharePoint. are you importing the AD groups via UPA?
Creating a SharePoint group and adding an Active Directory group to its members…this allows anyone in the Active Directory group to participate in the SharePoint group
Mapping roles directly to Active Directory groups and not using SharePoint groups at all.
here is couple of article which will explain your choices one over to other
Assign permission levels in SharePoint 2013
Using Active Directory Vs. SharePoint Groups
http://sergeluca.wordpress.com/2013/07/06/sharepoint-2013-use-ag-groups-yes-butdont-forget-the-security-token-caching-logontokencacheexpirationwindow-and-windowstokenlifetime/
Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog -
How to write a SQL Query without using group by clause
Hi,
Can anyone help me to find out if there is a approach to build a SQL Query without using group by clause.
Please site an example if is it so,
RegardsI hope this example could illuminate danepc on is problem.
CREATE or replace TYPE MY_ARRAY AS TABLE OF INTEGER
CREATE OR REPLACE FUNCTION GET_ARR return my_array
as
arr my_array;
begin
arr := my_array();
for i in 1..10 loop
arr.extend;
arr(i) := i mod 7;
end loop;
return arr;
end;
select column_value
from table(get_arr)
order by column_value;
select column_value,count(*) occurences
from table(get_arr)
group by column_value
order by column_value;And the output should be something like this:
SQL> CREATE or replace TYPE MY_ARRAY AS TABLE OF INTEGER
2 /
Tipo creato.
SQL>
SQL> CREATE OR REPLACE FUNCTION GET_ARR return my_array
2 as
3 arr my_array;
4 begin
5 arr := my_array();
6 for i in 1..10 loop
7 arr.extend;
8 arr(i) := i mod 7;
9 end loop;
10 return arr;
11 end;
12 /
Funzione creata.
SQL>
SQL>
SQL> select column_value
2 from table(get_arr)
3 order by column_value;
COLUMN_VALUE
0
1
1
2
2
3
3
4
5
6
Selezionate 10 righe.
SQL>
SQL> select column_value,count(*) occurences
2 from table(get_arr)
3 group by column_value
4 order by column_value;
COLUMN_VALUE OCCURENCES
0 1
1 2
2 2
3 2
4 1
5 1
6 1
Selezionate 7 righe.
SQL> Bye Alessandro -
Isse with using Grouping Sets in SQL Server 2008 R2
Hi,
I created a query in SQL Server 2012 using grouping sets that works fine. When I try to use the same query in SQL Server 2008 I get an error ("Inccorrect syntax near SETS").
I researched using grouping sets in 2008 and didn't see any issue with my query. What is different in grouping sets 2008 vs 2012?
SELECT tl.ClientRegionCd as [Client Region Code] , tl.ClientRegionDesc as [Region Name], count(tl.CompleteICN) as [Trauma Letters Sent]
from TORT_Trauma_Letters tl
Where CONVERT(VARCHAR(26), tl.SecondNoticeSent, 23) between '2014-06-12' and '2014-06-12'
GROUP BY GROUPING SETS((tl.ClientRegionCd, tl.ClientRegionDesc), ())
StacieCheck this blog post as how to deal with date ranges
http://sqlblog.com/blogs/aaron_bertrand/archive/2009/10/16/bad-habits-to-kick-mishandling-date-range-queries.aspx
For your result you can simply achieve your result with UNION ALL, e.g.
select Client, Region, Letters
from myTable
UNION ALL
select NULL, NULL, SUM(letters) as Letters
For every expert, there is an equal and opposite expert. - Becker's Law
My blog
My TechNet articles -
Distinct count inside a measure group with other measures
Hello,
I have 1 distinct count inside a measure group with other measures, sum, count etc. I know this is not recommended due to poor processing performance and query response time.
Processing performance I can live with if it means not having another measure group, which increases processing time anyway.
I have used the recommended approach before and it generated many questions about what this second measure group is for (visible via excel), even though I made the distinct count appear in the main measure group via a calculated measure.
(it would be nice if you could hide measure groups)
However my question is: is query response time only effected when the distinct count is used in the query? Or is query response time effected regardless if the distinct count is used or not??
Below is an extract from the 2005 distinct count optimizer white paper. It’s not completely clear but I assume if effects queries regardless if distinct count is used or not?
"By adding other measures to the measure group holding a distinct count measure, all of the other measures will be at the same granularity as the distinct count measure, resulting in inefficient data structures and suboptimal
queries."You might also be interested in reading this blog post, which deals with a similar scenario, to get a feeling for some of the things that might be going on behind the scenes:
http://cwebbbi.wordpress.com/2012/11/27/storage-engine-caching-measures-and-measure-groups/
Chris
Check out my MS BI blog I also do
SSAS, PowerPivot, MDX and DAX consultancy
and run public SQL Server and BI training courses in the UK -
To fetch data using group by function
Hi Guys,
I am having a table where it holds data with value with zero in one of the column and i need to fetch the records from the table using group by function but to display all the records if zero occurs in my table
for eg
table1
id,customer_name,country
0 sam aus
1 peter ind
1 peter ind
0 samy us
0 rayan nz
if i use select count(*),id from table1 group by id
i will get
count(*),id
3-0
1-2
but wat i need is like below
0 sam aus
0 samy us
0 rayan nz
2 peter ind
whenever zero is occurring i need to display all the records but group by should work for non zero recordsThe simplest way would be to have two queries and UNION them together. For example:
WITH test_data AS
( SELECT 0 AS id, 'sam' AS customer_name, 'aus' AS country FROM DUAL UNION ALL
SELECT 1 AS id, 'peter' AS customer_name, 'ind' AS country FROM DUAL UNION ALL
SELECT 1 AS id, 'peter' AS customer_name, 'ind' AS country FROM DUAL UNION ALL
SELECT 0 AS id, 'samy' AS customer_name, 'us' AS country FROM DUAL UNION ALL
SELECT 0 AS id, 'rayan' AS customer_name, 'nz' AS country FROM DUAL
SELECT cnt
, customer_name
, country
FROM ( SELECT id
, customer_name
, country
, COUNT(*) OVER (PARTITION BY id) AS cnt
, ROW_NUMBER() OVER (PARTITION BY id ORDER BY id) rn
FROM test_data
WHERE id != 0
WHERE rn = 1
UNION
SELECT id
, customer_name
, country
FROM test_data
WHERE id = 0
This gives the following results:
CNT CUSTO COU
0 rayan nz
0 sam aus
0 samy us
2 peter ind -
Error : 'The Connection can not be used to perform thsi operation
Dear All,
I am getting an error like 'The Connection can not be used to perform thsi operation, it is either close or Invalid in this context.
Below is the code what am using:
Sub Select_Query()
Dim SQL_String As String
Dim rs As ADODB.Recordset 'This holds the data
Dim cn As ADODB.Connection 'Declaring Connection
Dim cmdobj As ADODB.Command 'Declare command Object
'Sheets("Payment").Select
Set cn = New ADODB.Connection
cn.Open ("Provider=MSDAORA;Data Source=MyDatabase;User ID=Prasad; Password=Prasad12;")
Dim count_value As Long
count_value = WorksheetFunction.CountA(Worksheets("Payments").Range("A:A"))
For i = 4 To count_value
SQL_String = Worksheets("Payments").Range("AA" & i).Value
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open SQL_String, cn, adOpenForwardOnly, adLockOptimistic, adCmdText
Dim val As Integer
val = rs.recordCount
If val = 0 Then
Worksheets("Payments").Range("AZ" & i).Value = "No"
'Else
'Worksheets("Uploaded").Range("O" & i).Value = "Yes"
End If
cn.Close
Set con = Nothing
Next
'cn.Execute SQL_String
'con.Close
Set con = Nothing
End Sub
And select statment is picking one of the sheets, and SQL query is:
="SELECT sa.acct_id
FROM ci_sa sa, ci_sp sp, ci_sa_sp ss, ci_sp_geo spg,ci_acct_char cac
WHERE sa.sa_id = ss.sa_id
AND ss.sp_id = sp.sp_id
AND sp.sp_id = spg.sp_id
AND spg.geo_type_cd LIKE '%RR%'
AND spg.geo_val ='"&B4&"'
and sa.ACCT_ID=cac.ACCT_ID
AND cac.char_type_cd LIKE '%SDO%'
AND TRIM (char_val) IN ('"&Master!G9&"')"
Please help me in this..
Regards,
PrasadPlease, this is a Oracle forum, not a VBA forum. Mark this thread as answered and post it in a VBA forum.
-
Hi, I am trying to execute following query and group the results by supervisor_id.I am getting an error. Here is the Query
SELECT A.SUPERVISOR_ID, A.EMPLID, B.NAME, C.EMAIL_ADDR, (CONVERT(CHAR(10),A.JOB_ENTRY_DT,121))
FROM PS_JOB A, PS_NAMES B, PS_EMAIL_ADDRESSES C
WHERE A.EFFDT =
(SELECT MAX(A_ED.EFFDT) FROM PS_JOB A_ED
WHERE A.EMPLID = A_ED.EMPLID
AND A.EMPL_RCD = A_ED.EMPL_RCD
AND A_ED.EFFDT <= SUBSTRING(CONVERT(CHAR,GETDATE(),121), 1, 10)
AND A.EFFSEQ =
(SELECT MAX(A_ES.EFFSEQ) FROM PS_JOB A_ES
WHERE A.EMPLID = A_ES.EMPLID
AND A.EMPL_RCD = A_ES.EMPL_RCD
AND A.EFFDT = A_ES.EFFDT)
AND A.EMPLID = B.EMPLID
AND B.EFFDT =
(SELECT MAX(B_ED.EFFDT) FROM PS_NAMES B_ED
WHERE B.EMPLID = B_ED.EMPLID
AND B.NAME_TYPE = B_ED.NAME_TYPE
AND B_ED.EFFDT <= A.EFFDT)
AND B.EMPLID = C.EMPLID )
GROUP BY A.SUPERVISOR_ID
error:
Msg 8120, Level 16, State 1, Line 1
Column 'PS_JOB.EMPLID' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
Where did I go wrong.Why are you using GROUP BY?
You don't appear to be using an aggregate function (like COUNT or SUM).
Finally, don't post unformatted code. It makes it difficult to read.
select a.supervisor_id
,a.emplid
,b.name
,c.email_addr
,(convert(char(10)
,a.job_entry_dt
,121))
from ps_job a
,ps_names b
,ps_email_addresses c
where a.effdt = (select max(a_ed.effdt)
from ps_job a_ed
where a.emplid = a_ed.emplid
and a.empl_rcd = a_ed.empl_rcd
and a_ed.effdt <= substring(convert(char
,getdate()
,121)
,1
,10)
and a.effseq = (select max(a_es.effseq)
from ps_job a_es
where a.emplid = a_es.emplid
and a.empl_rcd = a_es.empl_rcd
and a.effdt = a_es.effdt)
and a.emplid = b.emplid
and b.effdt = (select max(b_ed.effdt)
from ps_names b_ed
where b.emplid = b_ed.emplid
and b.name_type = b_ed.name_type
and b_ed.effdt <= a.effdt)
and b.emplid = c.emplid)
group by a.supervisor_idEdited by: Paul Horth on 03-May-2012 02:30
Maybe you are looking for
-
Question about async scenario and WS call from BPM
Hello All Scenario is: Asynchronous SOAP to JDBC, via BPM. In BPM I'd like to call webservice to lookup some data. What possibilities woul'd you suggest in such case? Currently I'm trying to configure synchronous Sender step in BPM, but no lusk so f
-
Will i loose any of my photo albums when i upgrade my ipad to iOS 5?
will i loose any of my photo albums when i upgrade my ipad to iOS 5?
-
Internal table, variable,...when debug
Hi all, Is there any place I can see all internal table, variable,.. of a running transaction? thanks.
-
Guys, would like to ask for any hints. We are running ISA 4.0 based on WAS 6.4 in conjunction with IPC 4.0 and TREX 6.1. System performance is terrible. What parameter do you recommend to set up in order to improve performance? Thanks in advance, And
-
Anmeldung PSE 12 funktioniert nicht
Ich habe Photoshop Elements 12 gekauft. Die Anmeldung funktioniert aber nicht, das Programm meldet, dass der PC offline ist, obwohl Thunderbird und Firefox problemlos auf das Internet zugreifen können. Die Offline-Aktivierung kann ich nicht machen, d