Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Amalgamate fulltext searches

Author  Topic 

OldMySQLUser
Constraint Violating Yak Guru

301 Posts

Posted - 2009-01-14 : 05:21:37
I have two fulltext search scripts for different tables on the same database

script 1:

use Pardata
SELECT Distinct notes.Mortgage_Number
FROM [dbo].[format_notes_history] AS notes


WHERE FREETEXT
(notes.Mortgage_Note_Line_1,
'
ack* AND
A/E AND
Afford AND
Agreed Shortfall AND
AIC AND
AOE Order AND
Bailiff AND
CC AND
CC Case No AND
CCS AND
CCJ AND
Charge AND
Chq AND
Cheque received from AND
Cheque from Collection Agency AND
Collection Agency AND
Court AND
Crt AND
Deed of Covenant AND
DSS AND
Equitable Charge AND
F & F S AND
Signed Field Call Report AND
Form N63 AND
FCM AND
FT&C AND
Guarantor AND
I/E AND
Susp AOE Order AND
JDL AND
Judgment AND
Legal Proceedings AND
Offer AND
Offers AND
Outsourced AND
Payment AND
Per Month AND
Proposal AND
RDS & Court AND
RW AND
Settlement AND
Signed AND
Statement of Means AND
Voluntary Charge
')

order by notes_arch.Mortgage_Number

and script 2:

use Pardata
SELECT Distinct notes_arch.Mortgage_Number
FROM [dbo].[format_notes_archive_history] AS notes_arch


WHERE FREETEXT
(notes_arch.notes,
'
ack* AND
A/E AND
Afford AND
Agreed Shortfall AND
AIC AND
AOE Order AND
Bailiff AND
CC AND
CC Case No AND
CCS AND
CCJ AND
Charge AND
Chq AND
Cheque received from AND
Cheque from Collection Agency AND
Collection Agency AND
Court AND
Crt AND
Deed of Covenant AND
DSS AND
Equitable Charge AND
F & F S AND
Signed Field Call Report AND
Form N63 AND
FCM AND
FT&C AND
Guarantor AND
I/E AND
Susp AOE Order AND
JDL AND
Judgment AND
Legal Proceedings AND
Offer AND
Offers AND
Outsourced AND
Payment AND
Per Month AND
Proposal AND
RDS & Court AND
RW AND
Settlement AND
Signed AND
Statement of Means AND
Voluntary Charge
')

order by notes_arch.Mortgage_Number

How can I combine the two scripts in order to create a single (distinct) output of Mortgage Numbers for which the listed words appear in either of the two tables please?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-01-14 : 05:53:20
Use UNION without ALL.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page
   

- Advertisement -