Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Fulltext-search with field as searchvalue

Posted on 2013-06-20
1
Medium Priority
?
205 Views
Last Modified: 2013-06-20
Hi
I have the following code:
SELECT *,
(SELECT TOP 1 Datum FROM foOfferte_M1 B 
WHERE Kundennummer = 5 and B.Baustelle = A.Baustelle 
ORDER BY datum DESC) AS DatumOfferte
FROM foBaustellen_M1 A WHERE KundenLaufnummer = 5

Open in new window


It works but it is very slow. The field Baustelle is NTEXT-datatype. I tried to create a fulltextindex but this doesn't speed up the query.

is there another way to speed up or do query that data?
Thanks, Peter
0
Comment
Question by:formi
1 Comment
 
LVL 11

Accepted Solution

by:
Louis01 earned 2000 total points
ID: 39262180
Try this?

SELECT A.col1
     , A.col2
     , A.col3
     , MAX(Datum) as Datum
  FROM foBaustellen_M1 A 
        LEFT OUTER JOIN foOfferte_M1 B 
    ON B.Baustelle = A.Baustelle 
   AND B.Kundennummer = 5 
 WHERE A.KundenLaufnummer = 5
 GROUP BY A.col1
        , A.col2
        , A.col3

Open in new window

0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question