 




<?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; SELECT statement</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/tag/select-statement/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers</link>
	<description></description>
	<lastBuildDate>Sat, 18 May 2013 00:58:41 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Execute SQL SELECT via RUNSQLSTM error</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/execute-sql-select-via-runsqlstm-error/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/execute-sql-select-via-runsqlstm-error/#comments</comments>
		<pubDate>Wed, 11 Jan 2012 16:42:47 +0000</pubDate>
		<dc:creator>DanTheDane</dc:creator>
				<category><![CDATA[RUNSQLSTM]]></category>
		<category><![CDATA[SELECT statement]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[New Discussion Post by WoodEngineer]]></description>
				<content:encoded><![CDATA[New Discussion Post by WoodEngineer]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/execute-sql-select-via-runsqlstm-error/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>oracle explain plan from yesterday</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/oracle-explain-plan-from-yesterday/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/oracle-explain-plan-from-yesterday/#comments</comments>
		<pubDate>Fri, 12 Aug 2011 06:08:27 +0000</pubDate>
		<dc:creator>Nightoracle</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle 11g]]></category>
		<category><![CDATA[Oracle administration]]></category>
		<category><![CDATA[SELECT statement]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Is it possible to see the explain plan used by Oracle for a select statement that was run yesterday?]]></description>
				<content:encoded><![CDATA[<p>Is it possible to see the explain plan used by Oracle for a select statement that was run yesterday?</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/oracle-explain-plan-from-yesterday/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Modifying a Stored Procedure</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/modifying-a-stored-procedure/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/modifying-a-stored-procedure/#comments</comments>
		<pubDate>Thu, 09 Jun 2011 14:31:51 +0000</pubDate>
		<dc:creator>DJandLO</dc:creator>
				<category><![CDATA[Crystal Reports]]></category>
		<category><![CDATA[SELECT statement]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Database]]></category>
		<category><![CDATA[SQL stored procedures]]></category>
		<category><![CDATA[Stored Procedures]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[The stored procedure below pulls suspected duplicate records. What I need it to do is return suspected duplicates only if it meets the criteria of having a member record type (GEN) &#038; a non-member record type (WEB). But if the duplicates both have a non-member record type I don&#8217;t want it showing up on the [...]]]></description>
				<content:encoded><![CDATA[<p>The stored procedure below pulls suspected duplicate records. What I need it to do is return suspected duplicates only if it meets the criteria of having a member record type (GEN) &#038; a non-member record type (WEB). But if the duplicates both have a non-member record type I don&#8217;t want it showing up on the report. <br/><br/> set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go ALTER PROCEDURE [dbo]. AS BEGIN SELECT N.ID, N.LAST_NAME, N.FIRST_NAME, NA.ADDRESS_1, NA.ADDRESS_2, NA.CITY, NA.STATE_PROVINCE, NA.ZIP, NA.COUNTRY, N.MEMBER_TYPE FROM NAME N, NAME_ADDRESS NA, ( SELECT LAST_NAME, STATE_PROVINCE, COUNTRY, COUNT(1) COUNT1 FROM NAME WHERE LAST_NAME &lt;&gt; ” AND STATE_PROVINCE &lt;&gt; ” GROUP BY LAST_NAME, STATE_PROVINCE, COUNTRY HAVING COUNT(1) &gt; 1) T WHERE T.LAST_NAME = N.LAST_NAME AND T.STATE_PROVINCE = NA.STATE_PROVINCE AND T.STATE_PROVINCE = N.STATE_PROVINCE AND T.COUNTRY = NA.COUNTRY AND N.ID = NA.ID AND N.MAIL_ADDRESS_NUM = NA.ADDRESS_NUM – AND T.LAST_NAME = ‘HARRISON’ ORDER BY N.LAST_NAME, N.STATE_PROVINCE, N.COUNTRY END <br/><br/> Thanks, DJ<br/><br/></p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/modifying-a-stored-procedure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parameter in select statement</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/parameter-in-select-statement/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/parameter-in-select-statement/#comments</comments>
		<pubDate>Mon, 04 Oct 2010 21:31:36 +0000</pubDate>
		<dc:creator>Plugsharma</dc:creator>
				<category><![CDATA[SELECT statement]]></category>
		<category><![CDATA[SQL Parameters]]></category>
		<category><![CDATA[SQL statements]]></category>
		<category><![CDATA[T-SQL]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Hi, I need to pass a parameter into a stored procedure which values are dynamic always. Executing a variable which having the Select statement. Following query working fine. BEGIN DECLARE @strQuery NVARCHAR(MAX) DECLARE @CountryId INT DECLARE @CityId INT SET @CountryId = 2 SET @CityId = &#8216; AND CityId IN (23,45,85,86)&#8217; SELECT @strQuery= &#8216;SELECT VendorId From [...]]]></description>
				<content:encoded><![CDATA[<p>Hi,</p>
<p>I need to pass a parameter into a stored procedure which values are dynamic always. Executing a variable which having the Select statement.</p>
<p>Following query working fine.</p>
<p>BEGIN<br />
DECLARE @strQuery NVARCHAR(MAX)<br />
DECLARE @CountryId INT<br />
DECLARE @CityId INT</p>
<p>SET @CountryId = 2<br />
SET @CityId = &#8216; AND CityId IN (23,45,85,86)&#8217;</p>
<p>SELECT @strQuery= &#8216;SELECT VendorId From Vendors<br />
WHERE CountryId = &#8216;+@CountryId+&#8217; &#8216;+@CityId+&#8217;<br />
ORDERBY CreatedDate&#8217;</p>
<p>EXEC(@strQuery)<br />
END</p>
<p>I need to execute above in an open select statement instead of executing @strQuery.</p>
<p>Getting error as When trying through following script as &#8220;Conversion failed when converting the varchar value &#8216; AND CityId (23,45,85,86)&#8217; to data type int&#8221; </p>
<p>SELECT VendorId From Vendors<br />
WHERE CountryId = @CountryId + &#8216; &#8216; +@CityId<br />
ORDERBY CreatedDate</p>
<p>Please help me to get it working through above select statement.</p>
<p>Thanks</p>
<p>Sharma</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/parameter-in-select-statement/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SQL RPGLE &#8211; How to override data set data structure at run time</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/sqlrpgle-how-to-override-data-set-data-structure-at-run-time/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/sqlrpgle-how-to-override-data-set-data-structure-at-run-time/#comments</comments>
		<pubDate>Wed, 22 Sep 2010 13:43:04 +0000</pubDate>
		<dc:creator>NarkedDiver</dc:creator>
				<category><![CDATA[iSeries]]></category>
		<category><![CDATA[RPGLE]]></category>
		<category><![CDATA[SELECT statement]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Select statement problem]]></category>
		<category><![CDATA[SQLRPGLE]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I currently have an SQL RPGLE routine that receives a SELECT statement as a parameter and then fetches the data set into a data structure based on the file. This only works over a single file as the datastructure is created at compile time and has to be based on filea. I would like to [...]]]></description>
				<content:encoded><![CDATA[<p>I currently have an SQL RPGLE routine that receives a SELECT statement as a parameter and then fetches the data set into a data structure based on the file. <br/><br/> This only works over a single file as the datastructure is created at compile time and has to be based on filea. <br/><br/> I would like to make this routine flexible enough to run the SELECT statement over any file on our system. <br/><br/> The only options I can see at the moment are to either: <br/><br/> a) create a version of this routine for every file on our system (so that each program has the correct externally described data structure) <br/><br/> b) change the existing routine to contain an external data structure for every file on the system. <br/><br/> Both these solutions seem somewhat inelegant and inflexible &#8211; if we create a new file then it means either creating a new program or modding a program. <br/><br/> Is there a better way to do this or does the AS400 lack the required flexibility?<br/><br/></p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/sqlrpgle-how-to-override-data-set-data-structure-at-run-time/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Select statement in asp.net</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/select-statement-in-aspnet/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/select-statement-in-aspnet/#comments</comments>
		<pubDate>Sun, 18 Jul 2010 05:17:48 +0000</pubDate>
		<dc:creator>Pioneerinaspnet</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[SELECT statement]]></category>
		<category><![CDATA[SQL Select]]></category>
		<category><![CDATA[SQL statement]]></category>
		<category><![CDATA[WHERE clause]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[New Discussion Post by]]></description>
				<content:encoded><![CDATA[New Discussion Post by ]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/select-statement-in-aspnet/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>How do I use DateDiff in cobol using SELECT statement?</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/datediff/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/datediff/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 15:59:32 +0000</pubDate>
		<dc:creator>Ije</dc:creator>
				<category><![CDATA[AS/400]]></category>
		<category><![CDATA[COBOL]]></category>
		<category><![CDATA[DATEDIFF]]></category>
		<category><![CDATA[SELECT statement]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[how to use DateDiff in cobol using SELECT satement.]]></description>
				<content:encoded><![CDATA[<p>how to use DateDiff in cobol using SELECT satement.</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/datediff/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Select/Insert Statements causing out of memory error run under VB Script</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/selectinsert-statements-causing-out-of-memory-error-run-under-vb-script/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/selectinsert-statements-causing-out-of-memory-error-run-under-vb-script/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 08:43:51 +0000</pubDate>
		<dc:creator>TheBandit</dc:creator>
				<category><![CDATA[INSERT statement]]></category>
		<category><![CDATA[Oracle 10g]]></category>
		<category><![CDATA[Oracle 10g Database]]></category>
		<category><![CDATA[SELECT statement]]></category>
		<category><![CDATA[Windows Server 2003]]></category>
		<category><![CDATA[Windows Server 2003 32-bit]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Question Edited by Michael Tidmarsh]]></description>
				<content:encoded><![CDATA[Question Edited by Michael Tidmarsh]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/selectinsert-statements-causing-out-of-memory-error-run-under-vb-script/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Access 2003: Can&#8217;t filter Part-no&#8217;s by highest $Spend Plant/Site</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/access-2003-cant-filter-part-nos-by-highest-spend-plantsite/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/access-2003-cant-filter-part-nos-by-highest-spend-plantsite/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 18:32:40 +0000</pubDate>
		<dc:creator>GatorRobNC</dc:creator>
				<category><![CDATA[MS Access 2003]]></category>
		<category><![CDATA[SELECT statement]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I have a file of Part-no with the spend by Plant (or Location).  A given Part-no may have multiple records for the different Plant Locations. I am trying to capture one record for each Part-no that included the Plant with the highest spend and what that amount is. I tried to do a summary query [...]]]></description>
				<content:encoded><![CDATA[<p>I have a file of Part-no with the spend by Plant (or Location).  A given Part-no may have multiple records for the different Plant Locations.<br/><br/> I am trying to capture one record for each Part-no that included the Plant with the highest spend and what that amount is.<br/><br/> I tried to do a summary query sorting each part by descending order of Plant spend.  Then I made the query a Summary Query with a &#8220;Group By&#8221; Part-no and using the option of &#8220;First&#8221; Plant-Name.  Since the file is sorted by descending spend the &#8220;First&#8221; should get me the highest Plant Name for each part-no.  <br/><br/> This is not working correctly.  Many Part-no&#8217;s do not have the Highest Spend selected.<br/><br/> I see that there are options to use &#8220;From&#8221; together with &#8220;Where&#8221; but I don&#8217;t know if this will provide the right solution or how to use this feature.<br/><br/> Please advise any suggestions.<br/><br/> Thanks.<br/><br/></p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/access-2003-cant-filter-part-nos-by-highest-spend-plantsite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Select: Getting the previous records from a known record</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/getting-the-previous-records-from-a-known-record/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/getting-the-previous-records-from-a-known-record/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 16:37:49 +0000</pubDate>
		<dc:creator>bogeybetsy</dc:creator>
				<category><![CDATA[SELECT statement]]></category>
		<category><![CDATA[SQL Select]]></category>
		<category><![CDATA[SQL Select statement problem]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I issued a select statement like this: Select phone# from pltlcd where phone# &#62;= 985143525 fetch first 20 records only PLTLCD is a file sorted by phone#. From the first record retrieved by the aboe select statement, how do I get the 20 records in the file that exist before the returned set of the [...]]]></description>
				<content:encoded><![CDATA[<p>I issued a select statement like this:</p>
<p>Select phone# from pltlcd<br />
where phone# &gt;= 985143525<br />
fetch first 20 records only</p>
<p>PLTLCD is a file sorted by phone#.  From the first record retrieved by the aboe select statement, how do I get the 20 records in the file that exist before the returned set of the select statement above?</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/getting-the-previous-records-from-a-known-record/feed/</wfw:commentRss>
		<slash:comments>3</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/24 queries in 0.026 seconds using memcached
Object Caching 934/1055 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-18 11:43:10 -->