 




<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>IT Answers &#187; Query optimization</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/tag/query-optimization/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers</link>
	<description></description>
	<lastBuildDate>Thu, 23 May 2013 14:51:55 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Challenge improving query performance on large tables</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/challenge-improving-query-performance-on-large-tables/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/challenge-improving-query-performance-on-large-tables/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 14:21:07 +0000</pubDate>
		<dc:creator>Sport2000</dc:creator>
				<category><![CDATA[Query optimization]]></category>
		<category><![CDATA[Query performance]]></category>
		<category><![CDATA[SQL query optimization]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[SQL Server 2008 R2]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Hi, Here&#8217;s the structure of the db I&#8217;m using: * Table frs_ArticlesBDFournisseur which contains article main data.One row per article/color. Key is Refrefart (int). Size is over 220000 rows at the momemt. Only index is the PK (clusterred). * Table frs_ArticlesBDFournisseurTaille contains all the various sizes and barcode for the corresponding article/color from the previous [...]]]></description>
				<content:encoded><![CDATA[<p>Hi,<br/><br/> Here&#8217;s the structure of the db I&#8217;m using: * Table frs_ArticlesBDFournisseur which contains article main data.One row per article/color. Key is Refrefart (int). Size is over 220000 rows at the momemt. Only index is the PK (clusterred). * Table frs_ArticlesBDFournisseurTaille contains all the various sizes and barcode for the corresponding article/color from the previous table. Key is RefREFARTTAILLE (int). Size is over 1200000 rows at the moment. refrefart column also exists in this table to link with the previous table, altough there is no physical constraint linking the 2 tables. Indexes are PK (clustered), refrefart (non clustered) and refrefart,taille,codeean,codeeanfrs (non clustered).<br/><br/> Here&#8217;s what I want to do: I work at headquarters of franchise shops. I have to collect data from each selling point, match it with our own database (the one discribed above) to normalise the incoming data and complete it with more details. The best way to match an article is to use its barcode (when it exits in the shop data). We pack up to 2 barcodes with every article (callled CodeEan and CodeEanFrs from frs_ArticlesBDFournisseurTaille). I need to complete the information I have with the article size (called taille from frs_ArticlesBDFournisseurTaille), the article&#8217;s season (called Saison from frs_ArticlesBDFournisseur) and the number of different season the article has been existing in (to know whether it is a one season product or a permanent product).<br/><br/> Here&#8217;s the challenge for the query at hand: There is no constant data in frs_ArticlesBDFournisseurTaille with which I can do a GROUP BY. I need to get the latest product data (in case there is more than one season) and the total number of seasons.<br/><br/> Here&#8217;s the query I&#8217;ve designed: SELECT M.*, ART_REF, A.ART_PSEUDO, ART_NOM, ART_FEDAS, ART_ANNEECREATION, COU_CODE, COU_NOM, TGF_NOM, MRK_IDREF, MRK_NOM, MRK_NOM_ORI, CBI_EAN, CBI_EANFRS, B.RefRefArt, B.Taille AS sp2kTaille, CASE when B.CodeEan = &#8221; then null else B.CodeEan END AS sp2kEan, CASE when B.CodeEanFrs = &#8221; then null else B.CodeEanFrs END AS sp2kEanFrs, B.Saison, Coalesce(B.Pos, 0) as Permanent FROM gin_Mouvements M LEFT JOIN gin_Articles A ON M.MOV_ARTID=A.ART_ID LEFT JOIN gin_Couleurs C ON M.MOV_COUID=C.COU_ID LEFT JOIN gin_Tailles T ON M.MOV_TGFID=T.TGF_ID LEFT JOIN gin_Marques N ON A.ART_MRKID=N.MRK_ID LEFT JOIN gin_Ean E ON (M.MOV_ARTID=E.CBI_ARTID AND M.MOV_COUID=E.CBI_COUID AND M.MOV_TGFID=E.CBI_TGFID) OUTER APPLY (SELECT TOP 1 T.RefRefArt, CodeEan, CodeEANFrs, Taille, Art.Saison, Rank() over (order by T.RefREFART ASC) as Pos FROM frs_ArticlesBDFournisseurTaille T LEFT JOIN frs_ArticlesBDFournisseur Art ON T.RefREFART=Art.RefREFART WHERE (CodeEAN = E.CBI_EAN OR CodeEANFrs = CBI_EANFRS OR CodeEANFrs = CBI_EAN OR CodeEAN = CBI_EANFRS) ORDER BY RefREFART DESC) B<br/><br/> Query explained: All the first part, with all the left join, is to gather the data, relatively small, from the shops. There is no performance issue here. I&#8217;ve used an outer apply to avoid having to do a left join and the ON conditions which I couldn&#8217;t get to work to return at the same time the max(refrefart) and the total number of season; remember I can not make a group by.<br/><br/> Performances: This query runs at a 20row/s at best (nearly 20s to return 500 rows). The data in both tables described at the beginning is bound to increase twice a year by about 10000 new products and 6 times more for the barcodes. I&#8217;m afraid the performances will be degrading even more soon.<br/><br/> Advice ?: If anyone can see how to improve the query or rewrite the query differently or improve the db or else &#8230; please let me know.<br/><br/> Stats: Execution plan sum up: it is spending 57% on Nested Loops (Left Outer Join) and 40% on Index Scan (NonClustered)[sp2k_staging].[dbo].[frs_ArticlesBDFournisseurTaille].<art_ean] [T]. They are thick lines but they are mostly to the right of the diagram. The client statistics based on a TOP 500 run of the query: Client Execution Time 10:45:36   Query Profile Statistics      Number of INSERT, DELETE and UPDATE statements  0  0.0000   Rows affected by INSERT, DELETE, or UPDATE statements 0  0.0000   Number of SELECT statements        2  2.0000   Rows returned by SELECT statements     501  501.0000   Number of transactions         0  0.0000 Network Statistics      Number of server roundtrips       3  3.0000   TDS packets sent from client       3  3.0000   TDS packets received from server      119  119.0000   Bytes sent from client        2452 2452.0000   Bytes received from server       478675 478675.0000 Time Statistics      Client processing time        16895 16895.0000   Total execution time         18158 18158.0000   Wait time on server replies       1263 1263.0000<br/><br/> Thank you.<br/><br/></p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/challenge-improving-query-performance-on-large-tables/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Infinite recursion in SQL Server 2000</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/infinite-recursion/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/infinite-recursion/#comments</comments>
		<pubDate>Mon, 27 Sep 2010 06:52:18 +0000</pubDate>
		<dc:creator>Gomsbk</dc:creator>
				<category><![CDATA[Query optimization]]></category>
		<category><![CDATA[Recursion]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL query optimization]]></category>
		<category><![CDATA[SQL Server 2000]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[consider a recursive query in SQL.How to handle infinite recursion to make the query evaluation optimized?]]></description>
				<content:encoded><![CDATA[<p>consider a recursive query in SQL.How to handle infinite recursion to make the query evaluation optimized?<br/><br/></p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/infinite-recursion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AS400</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/as400-39/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/as400-39/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 16:21:35 +0000</pubDate>
		<dc:creator>CHARLESG</dc:creator>
				<category><![CDATA[Query optimization]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I am having problem with LF not reading correctly.  Can you turn off QUERY Optimizer for one job or a program?  If so how do you turn off Query Optimizer?]]></description>
				<content:encoded><![CDATA[<p>I am having problem with LF not reading correctly.  Can you turn off QUERY Optimizer for one job or a program?  If so how do you turn off Query Optimizer?</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/as400-39/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Calculating prior Query fields</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/calculating-prior-query-fields/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/calculating-prior-query-fields/#comments</comments>
		<pubDate>Tue, 12 May 2009 04:24:37 +0000</pubDate>
		<dc:creator>Bostic87</dc:creator>
				<category><![CDATA[DLookup]]></category>
		<category><![CDATA[Query optimization]]></category>
		<category><![CDATA[WHERE statement]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Inside my query, is four listed fields; date, printer, and a Start and End meter for daily meter readings to keep track of printer impressions. I&#8217;m trying to receive a return value by subtracting a meter reading from the START field in a current row and the END meter in the previous row depending on [...]]]></description>
				<content:encoded><![CDATA[<p>Inside my query, is four listed fields; date, printer, and a Start and End meter for daily meter readings to keep track of printer impressions. I&#8217;m trying to receive a return value by subtracting a meter reading from the START field in a current row and the END meter in the previous row depending on the printer selected in the PRINTER field. This will allow me to view the impressions from the shift before. I believe I need to use a DLOOKUP formula with a WHERE criteria but I&#8217;m not sure how to create it. Any help would be appreciated.</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/calculating-prior-query-fields/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>View is taking so much time for fetching data</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/view-is-taking-so-much-time-for-fetching-data/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/view-is-taking-so-much-time-for-fetching-data/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 09:05:55 +0000</pubDate>
		<dc:creator>440638</dc:creator>
				<category><![CDATA[Database Views]]></category>
		<category><![CDATA[Query optimization]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[i have created multilevel view (ie:- a view is inheritng data from multipe view) and its taking so much time while fetching the data. can i reduce time taking for fetching data.]]></description>
				<content:encoded><![CDATA[<p>i have created multilevel view (ie:- a view is inheritng data from multipe view)<br />
and its taking so much time while fetching the data.<br />
can i reduce time taking for fetching data.</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/view-is-taking-so-much-time-for-fetching-data/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Updating a field and counting unique field values from another fields all in the same query?</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/updating-a-field-and-counting-unique-field-values-from-another-fields-all-in-the-same-query/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/updating-a-field-and-counting-unique-field-values-from-another-fields-all-in-the-same-query/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 10:59:15 +0000</pubDate>
		<dc:creator>Grantp</dc:creator>
				<category><![CDATA[Query optimization]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Aggregate error]]></category>
		<category><![CDATA[SQL queries]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[How can I structure the following query to allow me to count the number of unique entries in a field named &#8220;amount&#8221; and using the same query, update another field named &#8220;unique&#8221; Here is what I am doing: SQL = &#8220;select amount, count(amount) from tblmessagein group by amount having count(*) = 1&#8243; If rsMessageIn.State = [...]]]></description>
				<content:encoded><![CDATA[<p>How can I structure the following query to allow me to count the number of unique entries in a field named &#8220;amount&#8221; and using the same query, update another field named &#8220;unique&#8221;</p>
<p>Here is what I am doing:</p>
<p>SQL = &#8220;select amount, count(amount) from tblmessagein group by amount having count(*) = 1&#8243;<br />
If rsMessageIn.State = adStateOpen Then<br />
   rsMessageIn.Close<br />
   rsMessageIn.Open SQL, cntblMessageIn, adOpenStatic, adLockOptimistic, -1<br />
ElseIf rsMessageIn.State = adStateClosed Then<br />
   rsMessageIn.Open SQL, cntblMessageIn, adOpenStatic, adLockOptimistic, -1<br />
End If<br />
Dim TempID As String<br />
&#8216;Set the number of records that have been found to be unique &#8211; used for searching, sending and updating later<br />
UniqueCount = rsMessageIn.RecordCount<br />
&#8216;Use the Record unique count to cycle through the original<br />
&#8216;amount values and then store them in unique message variables<br />
For ii = 1 To UniqueCount<br />
   With rsMessageIn<br />
       UniqueMsgText(ii) = .Fields(0).OriginalValue<br />
       If UniqueCount &gt; 1 Then .MoveNext<br />
       If UniqueCount = ii Then .MoveFirst<br />
   End With<br />
Next ii<br />
&#8216;<br />
For i = 1 To UniqueCount<br />
   SQLInbox3 = &#8220;select unique,amount from tblmessagein where amount = &#8216;&#8221; &#038; UniqueMsgText(i) &#038; &#8220;&#8216;&#8221;<br />
   If rsMessageIn.State = adStateOpen Then<br />
      rsMessageIn.Close<br />
      rsMessageIn.Open SQL, cntblMessageIn, adOpenStatic, adLockOptimistic, -1<br />
   ElseIf rsMessageIn.State = adStateClosed Then<br />
      rsMessageIn.Open SQL, cntblMessageIn, adOpenStatic, adLockOptimistic, -1<br />
   End If<br />
   With rsMessageIn<br />
        .Fields(5) = 1 &#8216;Set record uniqueness status<br />
        .Update<br />
   End With<br />
Next i<br />
&#8216;</p>
<p>This is what I would like to do, condense everything into one query instead of two as above, but I get &#8220;unique&#8221; is not part of the Aggregate function error:</p>
<p>SQL = &#8220;select unique,amount, count(amount) from tblmessagein group by amount having count(*) = 1&#8243;<br />
If rsMessageIn.State = adStateOpen Then<br />
   rsMessageIn.Close<br />
   rsMessageIn.Open SQL, cntblMessageIn, adOpenStatic, adLockOptimistic, -1<br />
ElseIf rsMessageIn.State = adStateClosed Then<br />
   rsMessageIn.Open SQL, cntblMessageIn, adOpenStatic, adLockOptimistic, -1<br />
End If<br />
Dim TempID As String<br />
&#8216;Set the number of records that have been found to be unique &#8211; used for searching, sending and updating later<br />
UniqueCount = rsMessageIn.RecordCount<br />
&#8216;Use the Record unique count to cycle through the original<br />
&#8216;amount values and then store them in unique message variables<br />
For ii = 1 To UniqueCount<br />
   With rsMessageIn<br />
       rsMessageIn.Fields(5) = 1 &#8216;Set record uniqueness status<br />
       rsMessageIn.Update<br />
       If UniqueCount &gt; 1 Then .MoveNext<br />
       If UniqueCount = ii Then .MoveFirst<br />
   End With<br />
Next ii</p>
<p>Basicly all I need to do is get all records that are unique based on the amount field, then update a field named unique with a 1 for each of the records found to have unique amount values! Can somebody please help me out on this one, I&#8217;m pulling my hair out already, thanks!</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/updating-a-field-and-counting-unique-field-values-from-another-fields-all-in-the-same-query/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Need help with this Oracle Query</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/oracle-query/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/oracle-query/#comments</comments>
		<pubDate>Sun, 05 Apr 2009 09:08:00 +0000</pubDate>
		<dc:creator>FidanSheza</dc:creator>
				<category><![CDATA[Oracle queries]]></category>
		<category><![CDATA[Oracle Query]]></category>
		<category><![CDATA[Query optimization]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[BPC_APPLICATIONS_TRANSACTIONS (Table) Application_no,Transaction_no,Transaction_date Step_id Dept_code Decision 20090045 1 01/14/2009 10:07:17 1 001 0 20090045 2 01/14/2009 10:07:17 70 007 0 20090045 3 01/14/2009 10:08:57 1 001 0 20090045 4 01/14/2009 10:08:57 60 006 0 20090045 5 01/14/2009 10:14:12 71 007 1 20090045 6 01/14/2009 10:14:41 61 006 1 20090045 7 01/18/2009 11:45:13 73 007 1 [...]]]></description>
				<content:encoded><![CDATA[<p>BPC_APPLICATIONS_TRANSACTIONS (Table)<br />
Application_no,Transaction_no,Transaction_date	Step_id	Dept_code	Decision<br />
20090045	       1	01/14/2009 10:07:17	1	001	0<br />
20090045	       2	01/14/2009 10:07:17	70	007	0<br />
20090045	       3	01/14/2009 10:08:57	1	001	0<br />
20090045	       4	01/14/2009 10:08:57	60	006	0<br />
20090045	      5	01/14/2009 10:14:12	71	007	1<br />
20090045	      6	01/14/2009 10:14:41	61	006	1<br />
20090045	      7	01/18/2009 11:45:13	73	007	1<br />
20090045	     8	01/18/2009 11:46:26	74	007	1<br />
20090045	     9	01/18/2009 11:47:13	7	001	1<br />
20090045	    11	01/18/2009 11:48:43	70	007	0<br />
20090045	    10	01/18/2009 11:48:43	1	001	0<br />
20090045	    12	01/27/2009 11:22:16	1	001	0<br />
20090045	    13	01/28/2009 10:30:56	71	007	1<br />
20090045	    14	01/28/2009 10:31:37	73	007	1<br />
20090045	   15	01/28/2009 10:32:14	74	007	1<br />
20090045	   16	01/28/2009 10:35:44	7	001	1<br />
20090045	   17	01/28/2009 10:35:53	1	001	0<br />
20090045	   18	01/28/2009 10:35:53	70	007	0<br />
20090045	   19	02/01/2009 10:35:53	71	007	0<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
select a.application_no,a.transaction_date dateIn,b.transaction_date dateout,<br />
                                 a.dept_code,b.decision<br />
                                 from bpc_applications_transactions a, bpc_applications_transactions b<br />
                                  where a.dept_code=007 and a.step_id in (71,73) and b.step_id in (71,73) and a.transaction_date in<br />
                                  (select transaction_date from bpc_applications_transactions<br />
                                      where step_id=71 and a.application_no=b.application_no  ) </p>
<p>                                     and b.transaction_date in  (select transaction_date from bpc_applications_transactions<br />
                                      where step_id=73 and a.application_no=b.application_no )<br />
                                       and<br />
                                      b.decision in (select nvl(decision,0) from bpc_applications_transactions<br />
                                      where step_id=73 and a.application_no=b.application_no  )<br />
                                      and a.application_no=b.application_no;<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
 When I am running the above query , i am  getting the output below:				</p>
<p>	APPLICATION_NO	DATEIN	DATEOUT	                  DECISION</p>
<p>	20090045	1/28/2009 10:30:56 ص	1/18/2009 11:45:13 ص	1<br />
	20090045	1/28/2009 10:30:56 ص	1/28/2009 10:31:37 ص	1<br />
	20090045	1/14/2009 10:14:12 ص	1/28/2009 10:31:37 ص	1<br />
	20090045	1/14/2009 10:14:12 ص	1/18/2009 11:45:13 ص	1<br />
	20090045	02/01/2009 10:35:53	1/28/2009 10:31:37 ص	1<br />
	20090045	02/01/2009 10:35:53	1/18/2009 11:45:13 ص	1<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
But I should get the output as:				</p>
<p>	APPLICATION_NO	DATEIN	DATEOUT	                  DECISION<br />
	20090045	1/28/2009 10:30:56 ص	1/28/2009 10:31:37 ص	1<br />
	20090045	1/14/2009 10:14:12 ص	1/18/2009 11:45:13 ص	1<br />
	20090045	02/01/2009 10:35		                      0</p>
<p>Can anyone help me to tune my query above to get the desired result? </p>
<p>Thanks,<br />
 SK&#8230;</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/oracle-query/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Matching External lists to your Database?</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/matching-external-lists-to-your-database/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/matching-external-lists-to-your-database/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 22:54:41 +0000</pubDate>
		<dc:creator>Nik14</dc:creator>
				<category><![CDATA[Query optimization]]></category>
		<category><![CDATA[SELECT statement]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL queries]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Hello everyone, I work in a telco and manage the data in the company&#8217;s CRM. I&#8217;m often given lists of company names by our alliance team, and asked to match the list against our database to see which companies already exist in the CRM and which don&#8217;t. At the moment I can only accomplish this [...]]]></description>
				<content:encoded><![CDATA[<p>Hello everyone,<br />
I work in a telco and manage the data in the company&#8217;s CRM.  I&#8217;m often given lists of company names by our alliance team, and asked to match the list against our database to see which companies already exist in the CRM and which don&#8217;t.  At the moment I can only accomplish this by one-to-one matching, using a LIKE &#8220;%part of company name%&#8221; search in Access, examining the results, and choosing the closest match.  The lists given to me by Alliance often have hand type names, using ampersands, excluding the INC off the end, incorrect spelling, inappropriate punctuation etc &#8211; which makes a SELECT WHERE &#8216;company name&#8217; is equal query completely fruitless. My question is this &#8211; can anyone recommend string matching software or an SQL query that will wash one list against another, finding the closest match with confidence intervals? I don&#8217;t know if this would involve fuzzy logic or not &#8211; but I&#8217;m convinced there needs to be a more efficient way to go about doing this.  Any advice is greatly appreciated, thanks a lot for reading.<br />
Nik</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/matching-external-lists-to-your-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>To retrieve records from SQL Server database</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/to-retrieve-records-from-database/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/to-retrieve-records-from-database/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 03:35:23 +0000</pubDate>
		<dc:creator>Pichha</dc:creator>
				<category><![CDATA[Query optimization]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Server development]]></category>
		<category><![CDATA[SQL Server Query]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Hello All, I have a requirement with sql server. Please find below the same. In database say we have a column named &#8220;Name&#8221; in a table. The records that are available in the table are say like Column_Name = Names Lean Metric Sequence Lean Operation Metric Lean Cleaning and so on&#8230;. Now, through some application [...]]]></description>
				<content:encoded><![CDATA[<p>Hello All,</p>
<p>I have a requirement with sql server. Please find below the same.</p>
<p>In database say we have a column named &#8220;Name&#8221; in a table. The records that are available in the table are say like </p>
<p>Column_Name = Names</p>
<p>Lean Metric<br />
Sequence Lean<br />
Operation Metric Lean<br />
Cleaning and so on&#8230;.</p>
<p>Now, through some application we are giving the input string as Project, so all the three records shown above should be retieved. </p>
<p>In the application i have filtered the condition like &#8220;Select name from table where name contains &#8220;Project&#8221;. so i am now getting all the three records. But i am also getting the record &#8220;Cleaning&#8221; as Lean is available as part of Cleaning. Now, I should get records like cleaning. </p>
<p>How can I frame a query for this?</p>
<p>The thing is that application should search for the name that are anywhere in the column(in our case it should etch records corresponding to Lean and Cleaning..</p>
<p>Thanks in Advance.<br />
Regards<br />
Arun</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/to-retrieve-records-from-database/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Need help with Oracle query</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/query-3/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/query-3/#comments</comments>
		<pubDate>Sat, 24 Jan 2009 06:46:01 +0000</pubDate>
		<dc:creator>Xaviervicky</dc:creator>
				<category><![CDATA[Oracle development]]></category>
		<category><![CDATA[Oracle queries]]></category>
		<category><![CDATA[Query optimization]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[how to display the third highest salary from an employees table thanks in advance]]></description>
				<content:encoded><![CDATA[<p>how to display the third highest salary from an employees table<br />
thanks in advance</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/query-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 3/28 queries in 0.060 seconds using memcached
Object Caching 907/1032 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-23 15:31:16 -->