The select assignment

The result of running:

dbGetQuery(conn=con, statement="SELECT count(*) FROM Frequency WHERE docid='10398_txt_earn'")
Solved the select projection

dbGetQuery(conn=con, statement="SELECT count(Frequency.term) FROM Frequency WHERE docid='10398_txt_earn' and count=1")
Solved union problem

dbGetQuery(conn=con, statement="SELECT count(*) FROM (SELECT Frequency.term FROM Frequency WHERE docid='10398_txt_earn' and count=1 UNION SELECT Frequency.term FROM Frequency WHERE docid='925_txt_trade' and count=1)")