Solved

Fulltext-search with field as searchvalue

Posted on 2013-06-20
1
193 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
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

744 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

20 Experts available now in Live!

Get 1:1 Help Now