Solved

Fulltext-search with field as searchvalue

Posted on 2013-06-20
1
194 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 500 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

919 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now