<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Kiran.D.N</title>
	<atom:link href="http://kirandn.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://kirandn.wordpress.com</link>
	<description>::WeB DevELopeRs::</description>
	<lastBuildDate>Sat, 07 Jan 2012 07:31:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='kirandn.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Kiran.D.N</title>
		<link>http://kirandn.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://kirandn.wordpress.com/osd.xml" title="Kiran.D.N" />
	<atom:link rel='hub' href='http://kirandn.wordpress.com/?pushpress=hub'/>
		<item>
		<title>SqlServer 2005 Date And Time Function</title>
		<link>http://kirandn.wordpress.com/2012/01/07/sqlserver-2005-date-and-time-function/</link>
		<comments>http://kirandn.wordpress.com/2012/01/07/sqlserver-2005-date-and-time-function/#comments</comments>
		<pubDate>Sat, 07 Jan 2012 07:31:49 +0000</pubDate>
		<dc:creator>kirandn</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://kirandn.wordpress.com/?p=110</guid>
		<description><![CDATA[DATEPART Function The DATEPART function allows retrieving any part of the date and time variable provided. This function is deterministic &#8230;<p><a href="http://kirandn.wordpress.com/2012/01/07/sqlserver-2005-date-and-time-function/">Continue reading &#187;</a></p><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kirandn.wordpress.com&amp;blog=23979747&amp;post=110&amp;subd=kirandn&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2><span style="color:#666699;">DATEPART Function</span></h2>
<p>The DATEPART function allows retrieving any part of the date and time variable provided. This function is deterministic except when used with days of the week.</p>
<p>The DATEPART function takes two parameters: the part of the date that you want to retrieve and the date itself. The DATEPART function returns an integer representing any of the following parts of the supplied date: year, quarter, month, day of the year, day, week number, weekday number, hour, minute, second, or millisecond.</p>
<p>For example, suppose that you want to retrieve the week number of <strong>January  1,2012 and December 31, 2012</strong> . You can use the following code:</p>
<pre>SELECT DATEPART(WEEK, 'Dec 31 2012');
<strong><span style="color:#993366;">Output</span> :</strong> 53
SELECT DATEPART(WEEK, 'Jan 1 2012');
<strong><span style="color:#993366;">Output</span> :</strong> 1</pre>
<p>Similarly, if you want to know which weekday a particular date falls on, you can use the WEEKDAY keyword with the DATEPART function:</p>
<pre>SELECT DATEPART(WEEKDAY, 'Jan 8 2012' )
<span style="color:#993366;"><strong>output:</strong></span>1</pre>
<p>Here sun=1 mon=2 tue=3 wed=4 thu=5 fri=6 and sat=7</p>
<h2><span style="color:#666699;">DATENAME Function</span></h2>
<p>The DATENAME nondeterministic function returns the name of the portion of the date and time variable. Just like the DATEPART function, the DATENAME function accepts two parameters: the portion of the date that you want to retrieve and the date. The DATENAME function can be used to retrieve any of the following: name of the year, quarter, month, day of the year, day, week, weekday, hour, minute, second, or millisecond of the specified date. For instance, you can determine the weekday name as well as the month name of a given date as follows:</p>
<pre>SELECT DATENAME(WEEKDAY, '1-26-2012' ) as day,DATENAME (MONTH, '1-26-2012' ) as month
<span style="color:#993366;"><strong>output:</strong></span>
<strong> day month </strong>
 Thursday   January</pre>
<h2><span style="color:#666699;">DAY, MONTH, and YEAR Functions</span></h2>
<p>DAY, MONTH and YEAR functions are deterministic. Each of these accepts a single date value as a parameter and returns respective portions of the date as an integer. The following example shows how various portions of the date and time value can be retrieved using these functions:</p>
<pre>SELECT DAY('Jan 8 2012'),MONTH('Jan 8 2012'),YEAR('Jan 8 2012')
<strong><span style="color:#993366;">output:</span> </strong>
<strong>day month year</strong>
8	1	2012</pre>
<p>DAY, MONTH and YEAR functions are functionally equivalent to executing DATEPART function with day, month or year as the first parameter, respectively.</p>
<h2><span style="color:#666699;">GETDATE and GETUTCDATE Functions</span></h2>
<p>GETDATE and GETUTCDATE functions both return the current date and time. However, GETUTCDATE returns the current Universal Time Coordinate (UTC) time, whereas GETDATE returns the date and time on the computer where SQL Server is running. The GETUTCDATE() function compares the time zone of SQL Server computer with the UTC time zone. Neither of these functions accepts parameters, and they are both non-deterministic. Here is an example:</p>
<pre>SELECT   GETDATE() AS local_date,   GETUTCDATE() AS UTC_date
<span style="color:#993366;"><strong>output: </strong></span>
<strong>local_date UTC_date</strong>
2012-01-07 12:05:30.043	2012-01-07 06:35:30.043</pre>
<h2><span style="color:#666699;">DATEADD Functions</span></h2>
<p>DATEADD function is deterministic; it adds a certain period of time to the existing date and time value. For instance, the following query determines the date 49 months from the current date:</p>
<pre>SELECT DATEADD(day, 359, GETDATE())AS '359_Days_from_now';
SELECT DATEADD(WEEK, 51, GETDATE())AS '51_Weeks_from_now';
SELECT DATEADD(month, 11, GETDATE())AS '11_Months_from_now';
<span style="color:#993366;"><strong>output:</strong></span>
<strong>359_Days_from_now</strong>
2012-12-31 12:12:47.107

<strong>51_Weeks_from_now</strong>
2012-12-29 12:12:47.107

<strong>11_Months_from_now</strong>
2012-12-07 12:12:47.107</pre>
<p>DATEADD is also often used to determine which rows qualify for a particular report.For example, the following report retrieves details on past two years by using (-2) as the second DATEADD parameter:</p>
<pre>SELECT   Date from kiran WHERE  date &gt; =  DATEADD(YEAR, -2, GETDATE())
<strong><span style="color:#993366;">Output:</span> </strong>
<strong>Date</strong>
2012-01-31 00:00:00.000
2012-01-31 00:00:00.000</pre>
<h2><span style="color:#666699;">DATEDIFF Function</span></h2>
<p>DATEDIFF function is deterministic; it accepts two DATETIME values and a date portion (minute, hour, day, month, etc) as parameters. DATEDIFF() determines the difference between the two date values passed, expressed in the date portion specified. Notice also that start date should come before the end date, if you&#8217;d like to see positive numbers in the result set.</p>
<p>DATEDIFF will work even if the end date is earlier than the start date &#8211; you will simply see the negative values in the output. Also keep in mind that DATEDIFF returns an INTEGER &#8211; it does not calculate fractions for you. This can cause unexpected results, like in the following query:</p>
<pre>SELECT   DATEDIFF (YEAR, '1/1/2012', '1/1/2013') as yeardiff,
DATEDIFF (month, '1/1/2012', '12/31/2012') as monthdiff,
DATEDIFF (day, '1/1/2012', '12/31/2012') as datesdiff
<span style="color:#993366;"><strong>output:</strong></span>
<strong> yeardiff monthdiff datesdiff</strong>
 1	  11	     365</pre>
<p>so if you care about accuracy then be sure to use the smallest fraction of the time possible when using DATEDIFF.</p>
<p>Enjoy The Code Keep Rocking&#8230;.!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kirandn.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kirandn.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kirandn.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kirandn.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kirandn.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kirandn.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kirandn.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kirandn.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kirandn.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kirandn.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kirandn.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kirandn.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kirandn.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kirandn.wordpress.com/110/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kirandn.wordpress.com&amp;blog=23979747&amp;post=110&amp;subd=kirandn&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kirandn.wordpress.com/2012/01/07/sqlserver-2005-date-and-time-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/94a8b63b04511b605370006669f83b28?s=96&#38;d=retro&#38;r=X" medium="image">
			<media:title type="html">kirandn</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER – 2005 – Last Ran Query – Recently Ran Query</title>
		<link>http://kirandn.wordpress.com/2011/12/19/sql-server-2005-last-ran-query-recently-ran-query/</link>
		<comments>http://kirandn.wordpress.com/2011/12/19/sql-server-2005-last-ran-query-recently-ran-query/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 10:31:24 +0000</pubDate>
		<dc:creator>kirandn</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://kirandn.wordpress.com/?p=105</guid>
		<description><![CDATA[SELECT deqs.last_execution_time AS [Time], dest.TEXT AS [Query] FROM sys.dm_exec_query_stats AS deqs CROSS APPLY sys.dm_exec_sql_text(deqs.sql_handle) AS dest ORDER BY deqs.last_execution_time DESC<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kirandn.wordpress.com&amp;blog=23979747&amp;post=105&amp;subd=kirandn&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>SELECT deqs.last_execution_time AS [Time], dest.TEXT AS [Query]<br />
FROM sys.dm_exec_query_stats AS deqs<br />
CROSS APPLY sys.dm_exec_sql_text(deqs.sql_handle) AS dest<br />
ORDER BY deqs.last_execution_time DESC</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kirandn.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kirandn.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kirandn.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kirandn.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kirandn.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kirandn.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kirandn.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kirandn.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kirandn.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kirandn.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kirandn.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kirandn.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kirandn.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kirandn.wordpress.com/105/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kirandn.wordpress.com&amp;blog=23979747&amp;post=105&amp;subd=kirandn&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kirandn.wordpress.com/2011/12/19/sql-server-2005-last-ran-query-recently-ran-query/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/94a8b63b04511b605370006669f83b28?s=96&#38;d=retro&#38;r=X" medium="image">
			<media:title type="html">kirandn</media:title>
		</media:content>
	</item>
		<item>
		<title>Calling server side methods using JavaScript and JQuery in ASP.Net</title>
		<link>http://kirandn.wordpress.com/2011/12/13/calling-server-side-methods-using-javascript-and-jquery-in-asp-net/</link>
		<comments>http://kirandn.wordpress.com/2011/12/13/calling-server-side-methods-using-javascript-and-jquery-in-asp-net/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 09:39:02 +0000</pubDate>
		<dc:creator>kirandn</dc:creator>
				<category><![CDATA[Asp.Net]]></category>

		<guid isPermaLink="false">http://kirandn.wordpress.com/?p=99</guid>
		<description><![CDATA[This is asked many times on asp.net forums, 1. How to call Server Side methods or functions using JavaScript in &#8230;<p><a href="http://kirandn.wordpress.com/2011/12/13/calling-server-side-methods-using-javascript-and-jquery-in-asp-net/">Continue reading &#187;</a></p><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kirandn.wordpress.com&amp;blog=23979747&amp;post=99&amp;subd=kirandn&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div>This is asked many times on asp.net forums,</div>
<div>1. How to call Server Side methods or functions using JavaScript in ASP.Net</div>
<div>2. How to call Server Side methods Client Side in ASP.Net</div>
<div>Now the answer is using jQuery.</div>
<div>jQuery allows you to call Server Side ASP.net methods from client side without any PostBack. Actually it is an AJAX call to the server but it allows us to call the method or function defined server side.</div>
<div><strong> </strong></div>
<div><strong>Syntax</strong></div>
<div>The figure below describes the syntax of the call.</div>
<div><img src="http://www.aspsnippets.com/Handlers/DownloadFile.ashx?File=d10bba27-1a5f-43f6-a7cc-d17f80f52e51.png" alt="Calling Server Side web methods in ASP.Net using JQuery JavaScript" /><br /> </div>
<div><strong>HTML Markup</strong></div>
<div>
<div>&lt;div&gt;</div>
<div>Your Name :</div>
<div>&lt;asp:TextBox ID=&#8221;txtUserName&#8221; runat=&#8221;server&#8221;&gt;&lt;/asp:TextBox&gt;</div>
<div>&lt;input id=&#8221;btnGetTime&#8221; type=&#8221;button&#8221; value=&#8221;Show Current Time&#8221;</div>
<div>    onclick = &#8221;ShowCurrentTime()&#8221; /&gt;</div>
<div>&lt;/div&gt;</div>
</div>
<p>&nbsp;</p>
<div>As you noticed above I have added a textbox when user can enter his name and a TML button that calls a JavaScript method to get the Current Time.</div>
<div><strong> </strong></div>
<div><strong>Client Side Methods</strong></div>
<div>
<div>&lt;script src=&#8221;scripts/jquery-1.3.2.min.js&#8221; type=&#8221;text/javascript&#8221;&gt;&lt;/script&gt;</div>
<div>&lt;script type = &#8221;text/javascript&#8221;&gt;</div>
<div>function ShowCurrentTime() {</div>
<div>    $.ajax({</div>
<div>        type: &#8221;POST&#8221;,</div>
<div>        url: &#8221;CS.aspx/GetCurrentTime&#8221;,</div>
<div>        data: &#8217;{name: &#8220;&#8216; + $(&#8220;#&lt;%=txtUserName.ClientID%&gt;&#8221;)[0].value + &#8217;&#8221; }&#8217;,</div>
<div>        contentType: &#8221;application/json; charset=utf-8&#8243;,</div>
<div>        dataType: &#8221;json&#8221;,</div>
<div>        success: OnSuccess,</div>
<div>        failure: function(response) {</div>
<div>            alert(response.d);</div>
<div>        }</div>
<div>    });</div>
<div>}</div>
<div>function OnSuccess(response) {</div>
<div>    alert(response.d);</div>
<div>}</div>
<div>&lt;/script&gt;</div>
</div>
<p>&nbsp;</p>
<div>Above the <strong>ShowCurrentTime</strong> method makes an AJAX call to the server and executes the <strong>GetCurrentTime</strong> method which accepts the username and returns a string value.</div>
<div> </div>
<div><strong>Server Side Methods</strong></div>
<div><strong>C#</strong></div>
<div>
<div>[System.Web.Services.WebMethod]</div>
<div>public static string GetCurrentTime(string name)</div>
<div>{</div>
<div>    return &#8221;Hello &#8220; + name + Environment.NewLine + &#8221;The Current Time is: &#8220;</div>
<div>        + DateTime.Now.ToString();</div>
<div>}</div>
</div>
<div> </div>
<div><strong>VB.Net</strong></div>
<div>
<div>&lt;System.Web.Services.WebMethod()&gt; _</div>
<div>Public Shared Function GetCurrentTime(ByVal name As String) As String</div>
<div>   Return &#8221;Hello &#8220; &amp; name &amp; Environment.NewLine &amp; &#8221;The Current Time is: &#8220; &amp; _</div>
<div>            DateTime.Now.ToString()</div>
<div>End Function</div>
</div>
<p>&nbsp;</p>
<div>The above method simply returns a greeting message to the user along with the current server time. An important thing to note is that the method is declared asstatic (C#) and Shared(VB.Net) and also it is declared as <strong>Web Method</strong> unless you do this you won’t be able to call the methods</div>
<div> </div>
<div>The figure below displays the output displayed to the user when the button is clicked</div>
<p><img src="http://aspsnippets.com/Handlers/DownloadFile.ashx?File=676f903a-e5de-479c-baf1-4b778410a496.png" alt="Calling Server Side Methods JavaScript and jQuery in ASP.Net" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kirandn.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kirandn.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kirandn.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kirandn.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kirandn.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kirandn.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kirandn.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kirandn.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kirandn.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kirandn.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kirandn.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kirandn.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kirandn.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kirandn.wordpress.com/99/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kirandn.wordpress.com&amp;blog=23979747&amp;post=99&amp;subd=kirandn&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kirandn.wordpress.com/2011/12/13/calling-server-side-methods-using-javascript-and-jquery-in-asp-net/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/94a8b63b04511b605370006669f83b28?s=96&#38;d=retro&#38;r=X" medium="image">
			<media:title type="html">kirandn</media:title>
		</media:content>

		<media:content url="http://www.aspsnippets.com/Handlers/DownloadFile.ashx?File=d10bba27-1a5f-43f6-a7cc-d17f80f52e51.png" medium="image">
			<media:title type="html">Calling Server Side web methods in ASP.Net using JQuery JavaScript</media:title>
		</media:content>

		<media:content url="http://aspsnippets.com/Handlers/DownloadFile.ashx?File=676f903a-e5de-479c-baf1-4b778410a496.png" medium="image">
			<media:title type="html">Calling Server Side Methods JavaScript and jQuery in ASP.Net</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL Tuning or SQL Optimization</title>
		<link>http://kirandn.wordpress.com/2011/12/13/sql-tuning-or-sql-optimization/</link>
		<comments>http://kirandn.wordpress.com/2011/12/13/sql-tuning-or-sql-optimization/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 07:26:47 +0000</pubDate>
		<dc:creator>kirandn</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://kirandn.wordpress.com/?p=96</guid>
		<description><![CDATA[Sql Statements are used to retrieve data from the database. We can get same results by writing different sql queries. &#8230;<p><a href="http://kirandn.wordpress.com/2011/12/13/sql-tuning-or-sql-optimization/">Continue reading &#187;</a></p><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kirandn.wordpress.com&amp;blog=23979747&amp;post=96&amp;subd=kirandn&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sql Statements are used to retrieve data from the database. We can get same results by writing different sql queries. But use of the best query is important when performance is considered. So you need to sql query tuning based on the requirement. Here is the list of queries which we use reqularly and how these sql queries can be optimized for better performance.</p>
<h3>SQL Tuning/SQL Optimization Techniques:</h3>
<p><strong>1)</strong> The sql query becomes faster if you use the actual columns names in SELECT statement instead of than &#8216;*&#8217;.</p>
<p><strong>For Example:</strong> Write the query as</p>
<p><code>SELECT id, first_name, last_name, age, subject FROM student_details;</code></p>
<p>Instead of:</p>
<p><code>SELECT * FROM student_details;</code></p>
<p><strong>2) </strong>HAVING clause is used to filter the rows after all the rows are selected. It is just like a filter. Do not use HAVING clause for any other purposes.<br />
<strong>For Example: </strong>Write the query as</p>
<p><code>SELECT subject, count(subject)<br />
FROM student_details<br />
WHERE subject != 'Science'<br />
AND subject != 'Maths'<br />
GROUP BY subject;</code></p>
<p>Instead of:</p>
<p><code>SELECT subject, count(subject)<br />
FROM student_details<br />
GROUP BY subject<br />
HAVING subject!= 'Vancouver' AND subject!= 'Toronto';</code></p>
<p><strong>3) </strong>Sometimes you may have more than one subqueries in your main query. Try to minimize the number of subquery block in your query.<br />
<strong>For Example: </strong>Write the query as</p>
<p><code>SELECT name<br />
FROM employee<br />
WHERE (salary, age ) = (SELECT MAX (salary), MAX (age)<br />
FROM employee_details)<br />
AND dept = 'Electronics';<br />
</code></p>
<p>Instead of:</p>
<p><code>SELECT name<br />
FROM employee<br />
WHERE salary = (SELECT MAX(salary) FROM employee_details)<br />
AND age = (SELECT MAX(age) FROM employee_details)<br />
AND emp_dept = 'Electronics';</code></p>
<p><strong>4) </strong>Use operator EXISTS, IN and table joins appropriately in your query.<br />
<strong>a) </strong>Usually IN has the slowest performance.<br />
<strong>b) </strong>IN is efficient when most of the filter criteria is in the sub-query.<br />
<strong>c) </strong>EXISTS is efficient when most of the filter criteria is in the main query.</p>
<p><strong>For Example: </strong>Write the query as</p>
<p><code>Select * from product p<br />
where EXISTS (select * from order_items o<br />
where o.product_id = p.product_id)</code></p>
<p>Instead of:</p>
<p><code>Select * from product p<br />
where product_id IN<br />
(select product_id from order_items</code></p>
<p><strong>5) </strong>Use EXISTS instead of DISTINCT when using joins which involves tables having one-to-many relationship.<br />
<strong>For Example: </strong>Write the query as</p>
<p><code>SELECT d.dept_id, d.dept<br />
FROM dept d<br />
WHERE EXISTS ( SELECT 'X' FROM employee e WHERE e.dept = d.dept);</code></p>
<p>Instead of:</p>
<p><code>SELECT DISTINCT d.dept_id, d.dept<br />
FROM dept d,employee e<br />
WHERE e.dept = e.dept;</code></p>
<p><strong>6) </strong>Try to use UNION ALL in place of UNION.<br />
<strong>For Example: </strong>Write the query as</p>
<p><code>SELECT id, first_name<br />
FROM student_details_class10<br />
UNION ALL<br />
SELECT id, first_name<br />
FROM sports_team;</code></p>
<p>Instead of:</p>
<p><code>SELECT id, first_name, subject<br />
FROM student_details_class10<br />
UNION<br />
SELECT id, first_name<br />
FROM sports_team;</code></p>
<p><strong>7) </strong>Be careful while using conditions in WHERE clause.<br />
<strong>For Example: </strong>Write the query as</p>
<p><code>SELECT id, first_name, age FROM student_details WHERE age &gt; 10;</code></p>
<p>Instead of:</p>
<p><code>SELECT id, first_name, age FROM student_details WHERE age != 10;</code></p>
<p>Write the query as</p>
<p><code>SELECT id, first_name, age<br />
FROM student_details<br />
WHERE first_name LIKE 'Chan%';<br />
</code></p>
<p>Instead of:</p>
<p><code>SELECT id, first_name, age<br />
FROM student_details<br />
WHERE SUBSTR(first_name,1,3) = 'Cha';<br />
</code></p>
<p>Write the query as</p>
<p><code>SELECT id, first_name, age<br />
FROM student_details<br />
WHERE first_name LIKE NVL ( :name, '%');<br />
</code></p>
<p>Instead of:</p>
<p><code>SELECT id, first_name, age<br />
FROM student_details<br />
WHERE first_name = NVL ( :name, first_name);<br />
</code></p>
<p>Write the query as</p>
<p><code>SELECT product_id, product_name<br />
FROM product<br />
WHERE unit_price BETWEEN MAX(unit_price) and MIN(unit_price)</code></p>
<p>Instead of:</p>
<p><code>SELECT product_id, product_name<br />
FROM product<br />
WHERE unit_price &gt;= MAX(unit_price)<br />
and unit_price &lt;= MIN(unit_price)</code></p>
<p>Write the query as</p>
<p><code>SELECT id, name, salary<br />
FROM employee<br />
WHERE dept = 'Electronics'<br />
AND location = 'Bangalore';</code></p>
<p>Instead of:</p>
<p><code>SELECT id, name, salary<br />
FROM employee<br />
WHERE dept || location= 'ElectronicsBangalore';</code></p>
<p>Use non-column expression on one side of the query because it will be processed earlier.</p>
<p>Write the query as</p>
<p><code>SELECT id, name, salary<br />
FROM employee<br />
WHERE salary &lt; 25000;</code></p>
<p>Instead of:</p>
<p><code>SELECT id, name, salary<br />
FROM employee<br />
WHERE salary + 10000 &lt; 35000;</code></p>
<p>Write the query as</p>
<p><code>SELECT id, first_name, age<br />
FROM student_details<br />
WHERE age &gt; 10;</code></p>
<p>Instead of:</p>
<p><code>SELECT id, first_name, age<br />
FROM student_details<br />
WHERE age NOT = 10;</code></p>
<p><strong>8) </strong>Use DECODE to avoid the scanning of same rows or joining the same table repetitively. DECODE can also be made used in place of GROUP BY or ORDER BY clause.<br />
<strong>For Example: </strong>Write the query as</p>
<p><code>SELECT id FROM employee<br />
WHERE name LIKE 'Ramesh%'<br />
and location = 'Bangalore';</code></p>
<p>Instead of:</p>
<p><code>SELECT DECODE(location,'Bangalore',id,NULL) id FROM employee<br />
WHERE name LIKE 'Ramesh%';</code></p>
<p><strong>9) </strong>To store large binary objects, first place them in the file system and add the file path in the database.</p>
<p><strong>10) </strong>To write queries which provide efficient performance follow the general SQL standard rules.</p>
<p><strong>a) </strong>Use single case for all SQL verbs<br />
<strong>b) </strong>Begin all SQL verbs on a new line<br />
<strong>c) </strong>Separate all words with a single space<br />
<strong>d) </strong>Right or left aligning verbs within the initial SQL verb</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kirandn.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kirandn.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kirandn.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kirandn.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kirandn.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kirandn.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kirandn.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kirandn.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kirandn.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kirandn.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kirandn.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kirandn.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kirandn.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kirandn.wordpress.com/96/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kirandn.wordpress.com&amp;blog=23979747&amp;post=96&amp;subd=kirandn&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kirandn.wordpress.com/2011/12/13/sql-tuning-or-sql-optimization/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/94a8b63b04511b605370006669f83b28?s=96&#38;d=retro&#38;r=X" medium="image">
			<media:title type="html">kirandn</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL Server 2005 Backup Types</title>
		<link>http://kirandn.wordpress.com/2011/11/19/sql-server-2005-backup-types/</link>
		<comments>http://kirandn.wordpress.com/2011/11/19/sql-server-2005-backup-types/#comments</comments>
		<pubDate>Sat, 19 Nov 2011 05:13:22 +0000</pubDate>
		<dc:creator>kirandn</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://kirandn.wordpress.com/?p=89</guid>
		<description><![CDATA[Full, Transaction Log, Differential, Partial, Differential Partial, File and Filegroup, and Copy Only Database Backups Full Database Backup Transaction Log &#8230;<p><a href="http://kirandn.wordpress.com/2011/11/19/sql-server-2005-backup-types/">Continue reading &#187;</a></p><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kirandn.wordpress.com&amp;blog=23979747&amp;post=89&amp;subd=kirandn&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2>Full, Transaction Log, Differential, Partial, Differential Partial, File and Filegroup, and Copy Only Database Backups</h2>
<ul>
<li>Full Database Backup</li>
<li>Transaction Log Backup</li>
<li>Differential Database Backup</li>
<li>Partial Database Backup</li>
<li>Differential Partial Database Backup</li>
<li>File and Filegroup Backups</li>
<li>Copy Only Database Backup</li>
</ul>
<h3>Full Database Backup</h3>
<p>A full database backup captures the entire database in one fell swoop. It can be used to restore a database to the time when the backup completed. A full database backup is often used during restore operations as a first step in recovering a database. Other backups are applied after the full backup is restored to bring the database closer in time to the actual moment of failure.</p>
<p><strong>Data Loss:</strong></p>
<p>A full database backup will not on its own provide full recovery up to the point of failure. A full database backup for SQL Server 2005 restores the database up to the time when the backup was completed. If you have more stringent data loss requirements – and most organizations will – you need to supplement your full database backups with other types of backups. Your best chance at preventing data loss is to use the full recovery model with transaction logs.</p>
<p><strong>Size:</strong></p>
<p>A full database backup will be the largest type of backup that there is.</p>
<p><strong>Resources Required:</strong></p>
<p>A full database backup requires a lot of system resources and can negatively impact system performance.</p>
<h3>Transaction Log Backup</h3>
<p>Only available under the full recovery model and the bulk logged recovery model. Transaction log backups allow for point in time recovery since each transaction is captured within the transaction log.</p>
<p><strong>Data Loss:</strong></p>
<p>The use of transaction log backups provides point in time recovery. As far as backups are concerned, the use of full backups combined with transaction logs can provide point in time recovery capabilities and minimize data loss.</p>
<p><strong>Size:</strong></p>
<p>Compared to other types of database backups, transaction log backups aren&#8217;t very large if they are scheduled regularly.</p>
<p><strong>Resources Required:</strong></p>
<p>Generally speaking, transaction log backups take up very little in the way of system resources.</p>
<h3>Differential Database Backup</h3>
<p>A differential database backup captures changes (and only the changes) made to the database since the last full database backup. This full database backup which differential backups reference is also called the differential base, since the differential backups are recording changes since the last full database backup was performed. The differential database backup records the changes to the database up to the time when the differential backup was completed.</p>
<p><strong>Data Loss:</strong></p>
<p>A differential backup provides additional protection from data loss than a full database backup, but does not on its own guarantee that some data won’t be lost. Your best chance at preventing data loss is to use the full recovery model with transaction logs.</p>
<p><strong>Size:</strong></p>
<p>The differential database backup will likely be a fraction of the size of the full database backup since only changes since the last full database backup are saved. However, if you have multiple differential database backups between each full database backup, each differential database backup will be larger than the one before it, since all differential database backups record ALL changes since the last full database backup.</p>
<p><img title="Differential Backups in SQL Server 2005" src="http://dbarecovery.com/images/sql-2005-differential-backups.jpg" alt="Differential backups in SQL Server 2005" /></p>
<p><strong>Resources Required:</strong></p>
<p>The overhead required to perform a differential backup is significantly less than what is required for a full database backup since only the changes since the last full database backup are being backed up.</p>
<h3>Partial Database Backup</h3>
<p>Partial backups were introduced for SQL Server 2005. Partial backups will backup the primary filegroup, any read/write file groups, and any read-only files that are specified during the backup. The partial backup is designed to not backup any data that is placed in a read-only file group. So, you can use a partial backup to backup your entire database – except for the read only data. Partial backups are meant to be used in a simple recovery model situation, although they can be used in a full recovery model situation as well.</p>
<p><strong>Data Loss:</strong></p>
<p>The partial backup provides bare minimum protection from data loss. The partial backup serves as a base for differential partial backups – which can be applied to the partial backup to bring the database closer to a point in time near the actual database failure. A full recovery model with transaction logs provides the best chance to restore the database up to the point of failure.</p>
<p><strong>Size:</strong></p>
<p>A key advantage of using a partial backup as opposed to a full database backup is the reduced file size. The read only filegroups only have to be saved once, therefore the partial backups will be smaller than what would be required for a full database backup.</p>
<p><strong>Resources Required:</strong></p>
<p>The strain on the database will likely be much less for a partial database backup than it is for a full database backup since specified read only filegroups won’t have to be backed up.</p>
<h3>Differential Partial Database Backup</h3>
<p>Differential partial backups use the most recent partial backup as their differential base. They work very similar to a differential backup, except (with some exceptions) they capture only changes made to read/write filegroups .</p>
<p>If you add, drop, or change the status of any of your filegroups, you’re best off taking a partial backup prior to resuming differential partial backups. Filegroup changes can have unintended consequences with differential partial backups.</p>
<p><strong>Data Loss:</strong></p>
<p>Differential Partial provide a reduced chance of data loss from a partial backup alone, since the differential partial backups are performed between partial backups.</p>
<p><strong>Size:</strong></p>
<p>A differential partial backup should be relatively small given that it won’t backup specified read only filegroups and uses the most recent partial backup as its base.</p>
<p><strong>Resources Required:</strong></p>
<p>The resources required for a differential partial backup will be relatively small compared to full database backups and partial backups.</p>
<h3>File and Filegroup Backups</h3>
<p>This primarily applies to very large databases (VLDB) with multiple filegroups that have strict availability requirements. In these instances, sometimes it takes too long to perform a full backup, or the size of a full backup is extremely large.</p>
<p>If you add, drop, or change the status of any of your filegroups, you’re best off taking a partial backup prior to resuming differential partial backups. Filegroup changes can have unintended consequences with differential partial backups.</p>
<p><strong>Data Loss:</strong></p>
<p>Data loss is minimized with file and filegroup backups through the proper use of transaction log backups. File and Filegroup backups can only be performed under a full recovery model or a bulk logged recovery model.</p>
<p><strong>Size:</strong></p>
<p>The size of individual file or filegroup backups will obviously be smaller than the size required for a full database backup – which is one of the key advantages of using file and filegroup backups in VLDB situations.</p>
<p><strong>Resources Required:</strong></p>
<p>While there is overhead involved in backing up any portion of a VLDB, the resources will likely be much less than the resources required for performing a full database backup on a very large database.</p>
<h3>Copy Only Database Backup</h3>
<p>Copy Only backups in SQL Server 2005 must be performed using T-SQL and are not logged in the backup and restore sequence for the database. In other words, you can’t apply differential backups to this database backup, it is an independent copy separate from the original database. The transaction log is unaffected (will not be truncated) during this type of backup. You might consider making a copy only backup for a special purpose – like database development or testing.</p>
<p><strong>Data Loss:</strong></p>
<p>Not applicable. A copy only database backup is used to make a copy of the database and isn’t part of a backup and recovery plan.</p>
<p><strong>Size:</strong></p>
<p>Not Applicable. Not part of the overall backup and recovery plan.</p>
<p><strong>Resources Required:</strong></p>
<p>Resources required for a Copy Only backup would be similar to a full database backup.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kirandn.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kirandn.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kirandn.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kirandn.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kirandn.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kirandn.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kirandn.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kirandn.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kirandn.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kirandn.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kirandn.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kirandn.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kirandn.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kirandn.wordpress.com/89/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kirandn.wordpress.com&amp;blog=23979747&amp;post=89&amp;subd=kirandn&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kirandn.wordpress.com/2011/11/19/sql-server-2005-backup-types/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/94a8b63b04511b605370006669f83b28?s=96&#38;d=retro&#38;r=X" medium="image">
			<media:title type="html">kirandn</media:title>
		</media:content>

		<media:content url="http://dbarecovery.com/images/sql-2005-differential-backups.jpg" medium="image">
			<media:title type="html">Differential Backups in SQL Server 2005</media:title>
		</media:content>
	</item>
		<item>
		<title>which is best Language to Develop Web Applications&#8230;?</title>
		<link>http://kirandn.wordpress.com/2011/11/14/which-is-best-language-to-develop-web-applications/</link>
		<comments>http://kirandn.wordpress.com/2011/11/14/which-is-best-language-to-develop-web-applications/#comments</comments>
		<pubDate>Mon, 14 Nov 2011 12:23:40 +0000</pubDate>
		<dc:creator>kirandn</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://kirandn.wordpress.com/?p=87</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kirandn.wordpress.com&amp;blog=23979747&amp;post=87&amp;subd=kirandn&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<a href="http://polldaddy.com/poll/5668073">Take Our Poll</a>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kirandn.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kirandn.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kirandn.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kirandn.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kirandn.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kirandn.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kirandn.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kirandn.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kirandn.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kirandn.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kirandn.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kirandn.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kirandn.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kirandn.wordpress.com/87/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kirandn.wordpress.com&amp;blog=23979747&amp;post=87&amp;subd=kirandn&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kirandn.wordpress.com/2011/11/14/which-is-best-language-to-develop-web-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/94a8b63b04511b605370006669f83b28?s=96&#38;d=retro&#38;r=X" medium="image">
			<media:title type="html">kirandn</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL Functions</title>
		<link>http://kirandn.wordpress.com/2011/11/12/sql-functions/</link>
		<comments>http://kirandn.wordpress.com/2011/11/12/sql-functions/#comments</comments>
		<pubDate>Sat, 12 Nov 2011 10:22:16 +0000</pubDate>
		<dc:creator>kirandn</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://kirandn.wordpress.com/?p=69</guid>
		<description><![CDATA[Types of Functions There are several basic types and categories of functions in SQL99 and vendor implementations of SQL. The &#8230;<p><a href="http://kirandn.wordpress.com/2011/11/12/sql-functions/">Continue reading &#187;</a></p><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kirandn.wordpress.com&amp;blog=23979747&amp;post=69&amp;subd=kirandn&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Types of Functions</strong></p>
<p><strong></strong>There are several basic types and categories of functions in SQL99 and vendor implementations of SQL. The basic types of functions are:</p>
<p><em><strong>Aggregate functions</strong></em><br />
Operate against a collection of values, but return a single, summarizing value.<br />
<em><strong>Scalar functions</strong></em><br />
Operate against a single value, and return a single value based on the input value. Some scalar functions, CURRENT_TIME for example, do not require any arguments.</p>
<h3>Aggregate Functions</h3>
<p>Aggregate functions return a single value based upon a set of other values. If used among many other expressions in the item list of a <em>SELECT</em>statement, the <em>SELECT</em> must have a <em>GROUP BY</em> clause. No <em>GROUP BY</em> clause is required if the aggregate function is the only value retrieved by the<em>SELECT</em> statement. The supported aggregate functions and their syntax are listed in .</p>
<table border="1">
<caption> </caption>
<tbody>
<tr>
<th rowspan="1" colspan="1"><em>Function</em></th>
<th rowspan="1" colspan="1">Usage</th>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>AVG(expression)</em></td>
<td rowspan="1" colspan="1">Computes the average value of a column by the expression</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>COUNT(expression)</em></td>
<td rowspan="1" colspan="1">Counts the rows defined by the expression</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>COUNT(*)</em></td>
<td rowspan="1" colspan="1">Counts all rows in the specified table or view</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>MIN(expression)</em></td>
<td rowspan="1" colspan="1">Finds the minimum value in a column by the expression</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>MAX(expression)</em></td>
<td rowspan="1" colspan="1">Finds the maximum value in a column by the expression</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>SUM(expression)</em></td>
<td rowspan="1" colspan="1">Computes the sum of column values by the expression</td>
</tr>
</tbody>
</table>
<p>AVG and SUM</p>
<p>The AVG function computes the average of values in a column or an expression. SUM computes the sum. Both functions work with numeric values and ignore NULL values. They also can be used to compute the average or sum of all distinct values of a column or expression.</p>
<p>AVG and SUM are supported by Microsoft SQL Server, MySQL, Oracle, and PostgreSQL.</p>
<p>Example</p>
<p>The following query computes average year-to-date sales for each type of book:</p>
<p>SELECT type, AVG( ytd_sales ) AS &#8220;average_ytd_sales&#8221;<br />
FROM titles<br />
GROUP BY type;<br />
This query returns the sum of year-to-date sales for each type of book:</p>
<p>SELECT type, SUM( ytd_sales )<br />
FROM titles<br />
GROUP BY type;<br />
COUNT</p>
<p>The COUNT function has three variations. COUNT(*) counts all the rows in the target table whether they include nulls or not. COUNT(expression) computes the number of rows with non-NULL values in a specific column or expression. COUNT(DISTINCT expression) computes the number of distinct non-NULL values in a column or expression.</p>
<p>Examples</p>
<p>This query counts all rows in a table:</p>
<p>SELECT COUNT(*) FROM publishers;<br />
The following query finds the number of different countries where publishers are located:</p>
<p>SELECT COUNT(DISTINCT country) &#8220;Count of Countries&#8221;<br />
FROM publishers<br />
MIN and MAX</p>
<p>MIN(expression) and MAX(expression) find the minimum and maximum value (string, datetime, or numeric) in a set of rows. DISTINCT or ALL may be used with these functions, but they do not affect the result.</p>
<p>MIN and MAX are supported by Microsoft SQL Server, MySQL, Oracle, and PostgreSQL.</p>
<p>MySQL also supports the functions LEAST( ) and GREATEST( ), providing the same capabilities.</p>
<p>Examples</p>
<p>The following query finds the best and worst sales for any title on record:</p>
<p>SELECT &#8216;MIN&#8217; = MIN(ytd_sales), &#8216;MAX&#8217; = MAX(ytd_sales)<br />
FROM titles;<br />
Aggregate functions are used often in the HAVING clause of queries with GROUP BY. The following query selects all categories (types) of books that have an average price for all books in the category higher than $15.00:</p>
<p>SELECT type &#8216;Category&#8217;, AVG( price ) &#8216;Average Price&#8217;<br />
FROM titles<br />
GROUP BY type<br />
HAVING AVG(price) &gt; 15</p>
<h3>Scalar Functions</h3>
<p>Scalar functions fall into the categories listed</p>
<table border="1">
<caption><strong>Categories of Scalar Functions</strong><strong><a name="49091"></a></strong></caption>
<tbody>
<tr>
<th rowspan="1" colspan="1">Function Category</th>
<th rowspan="1" colspan="1">Explanation</th>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>Built-in</em></td>
<td rowspan="1" colspan="1">Performs operations on values or settings built into the database.Oracle uses the term &#8220;built-in&#8221; to describe all the specialty functions that are provided by Oracle, and thus &#8220;built into&#8221; their DBMS. This is a distinct and separate usage from the built-in functions described here.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>Date &amp; Time</em></td>
<td rowspan="1" colspan="1">Performs operations on datetime fields and returns values in datetime format.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>Numeric</em></td>
<td rowspan="1" colspan="1">Performs operations on numeric values and returns numeric values.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>String</em></td>
<td rowspan="1" colspan="1">Performs operations on character values (<em>char</em><strong> ,</strong> <em>varchar, nchar, nvarchar, and CLOB</em>) and returns a string or numeric value.</td>
</tr>
</tbody>
</table>
<p>Note that <em>CASE</em> and <em>CAST</em> are both functions. However, they are detailed in Chapter 3 because of their complexity and frequent usage in SQL-data statements.</p>
<h3>Built-in Scalar Functions</h3>
<p>SQL99 built-in scalar functions identify the current user session, and also characteristics of the current user session, such as the current session privileges. Built-in scalar functions are almost always nondeterministic. The first three functions listed in  are built-in functions that fall into the date-and-time category of functions. Although the four vendors provide many additional functions beyond these SQL built-ins, the SQL standard declares only those listed in</p>
<table border="1">
<caption><strong><a name="84804"></a></strong><strong>SQL99 Built-in Scalar Functions</strong></caption>
<tbody>
<tr>
<th rowspan="1" colspan="1"><em>Function</em></th>
<th rowspan="1" colspan="1">Usage</th>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>CURRENT_DATE</em></td>
<td rowspan="1" colspan="1">Identifies the current date.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>CURRENT_TIME</em></td>
<td rowspan="1" colspan="1">Identifies the current time.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>CURRENT_TIMESTAMP</em></td>
<td rowspan="1" colspan="1">Identifies the current date and time.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>CURRENT_USER</em></td>
<td rowspan="1" colspan="1">Identifies the currently active user within the database server.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>SESSION_USER</em></td>
<td rowspan="1" colspan="1">Identifies the currently active Authorization ID, if it differs from the user.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>SYSTEM_USER</em></td>
<td rowspan="1" colspan="1">Identifies the currently active user within the host operating system.</td>
</tr>
</tbody>
</table>
<p>Microsoft SQL Server supports all the built-in scalar functions. Oracle does not support the built-in scalar functions shown above; however, it supports<em>USER</em> as a synonym of <em>CURRENT_USER</em> and <em>SYSDATE</em> as a synonym of <em>CURRENT_TIMESTAMP</em>. MySQL supports all the SQL99 built-in scalar functions, plus both of Oracle&#8217;s variants. PostgreSQL supports <em>USER</em>, as defined in SQL99, as a synonym for <em>CURRENT_USER</em>. In addition, MySQL supports <em>NOW( )</em> and <em>UNIX_TIMESTAMP( )</em> as synonyms of the function <em>CURRENT_TIMESTAMP</em>. PostgreSQL supports all the SQL99 built-in scalar functions except <em>SESSION_USER</em>.</p>
<h4>Example</h4>
<p>The following queries retrieve the values from built-in functions. Notice that the various vendors return dates in their native formats:</p>
<pre><code>/* On MySQL */</code>
<code>SELECT CURRENT_TIMESTAMP;</code>
<code>-&gt; '2001-12-15 23:50:26'</code>
<code> </code>
<code>/* On Microsoft SQL Server */</code>
<code>SELECT CURRENT_TIMESTAMP</code>
<code>GO</code>
<code>-&gt; 'Dec 15,2001 23:50:26'</code>
<code> </code>
<code>/* On Oracle */</code>
<code>SELECT USER FROM dual;</code>
<code>-&gt; dylan</code></pre>
<h3><a name="_Toc484170294"></a>Numeric Scalar Functions</h3>
<p>The list of official SQL99 numeric functions is rather small. The various vendors provide quite a large supplement of mathematical and statistical functions. MySQL supports many of these commands in its SQL99 incarnations. The other database products offer the same capabilities of numeric scalar functions through their own internally defined functions, but they do not share the same name as those declared by the SQL standard. The supported numeric functions and syntax are listed in</p>
<table border="1">
<caption><strong>SQL99 Numeric Functions</strong><strong><a name="70012"></a></strong></caption>
<tbody>
<tr>
<th rowspan="1" colspan="1"><em>Function</em></th>
<th rowspan="1" colspan="1">Usage</th>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>BIT_LENGTH(expression)</em></td>
<td rowspan="1" colspan="1">Returns an integer value representing the number of bits in an expression.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>CHAR_LENGTH(expression)</em></td>
<td rowspan="1" colspan="1">Returns an integer value representing the number of characters in an expression.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>EXTRACT(datetime_expression datepart FROM expression)</em></td>
<td rowspan="1" colspan="1">Allows the datepart to be extracted (<em>YEAR</em>, <em>MONTH</em>, <em>DAY</em>, <em>HOUR</em>, <em>MINUTE</em>, <em>SECOND</em>,<em>TIMEZONE_HOUR</em>, or <em>TIMEZONE_MINUTE </em>) from an expression.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>OCTET_LENGTH(expression)</em></td>
<td rowspan="1" colspan="1">Returns an integer value representing the number of octets in an expression. This value is the same as<em>BIT_LENGTH</em>/8.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>POSITION(starting_string</em><em>IN search_string)</em></td>
<td rowspan="1" colspan="1">Returns an integer value representing the starting position of a string within the search string.</td>
</tr>
</tbody>
</table>
<p>BIT_LENGTH, CHAR_LENGTH, and OCTET_LENGTH</p>
<p>The closest any of the vendors get to the <em>BIT_LENGTH</em> function is Oracle. Oracle supports the <em>LENGTHB</em> function, which returns an integer value representing the number of bytes in an expression.</p>
<p>MySQL and PostgreSQL support <em>CHAR_LENGTH</em> and the SQL99 synonym <em>CHARACTER_LENGTH( )</em>. PostgreSQL also supports <em>EXTRACT( )</em>, <em>OCTET_LENGTH( )</em>, and <em>POSITION( )</em> as per the SQL99 standard. The other two vendors each have a similar function that provides identical functionality. SQL Server provides the <em>LEN</em> function and Oracle provides the <em>LENGTH</em> function.</p>
<p>MySQL and PostgreSQL also fully support the <em>OCTET_LENGTH</em> function.</p>
<p><a name="_Toc484170296"></a>Example</p>
<p>The following example determines the length of a string and a value retrieved from a column:</p>
<pre><code>/* On MySQL and PostgreSQL */</code>
<code>SELECT CHAR_LENGTH('hello');</code>
<code>SELECT OCTET_LENGTH(book_title) FROM titles;</code>
<code> </code>
<code>/* On Microsoft SQL Server */</code>
<code>SELECT DATALENGTH(title) </code>
<code>FROM titles</code>
<code>WHERE type = 'popular_comp'</code>
<code>GO</code>
<code> </code>
<code>/* On Oracle */</code>
<code>SELECT LENGTH('HORATIO') "Length of characters"</code>
<code>FROM dual;</code>
<code> </code>
<code> </code></pre>
<p>EXTRACT</p>
<p>The <em>EXTRACT</em> function is not supported by the database vendors, except for PostgreSQL and MySQL.</p>
<p>Each vendor supports a separate command to accomplish the same functionality. Oracle uses the <em>TO_CHAR</em> function to extract a portion of a date into a character string. SQL Server uses the <em>CONVERT</em> function to extract a portion of a date.</p>
<p>MySQL implementation is extended somewhat beyond the SQL99 standard. The SQL99 standard does not have a provision for returning multiple fields in the same call to <em>EXTRACT( )</em> (e.g., &#8220;DAY_HOUR&#8221;). The MySQL extensions try to accomplish what the combination <em>DATE_TRUNC( )</em> and<em>DATE_PART( )</em> do in PostgreSQL. MySQL supports the dateparts listed in</p>
<table border="1">
<caption><strong>MySQL Dateparts</strong><strong><a name="89585"></a></strong></caption>
<tbody>
<tr>
<th rowspan="1" colspan="1">Type value</th>
<th rowspan="1" colspan="1">Meaning</th>
<th rowspan="1" colspan="1">Expected format</th>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>SECOND</em></td>
<td rowspan="1" colspan="1">Seconds</td>
<td rowspan="1" colspan="1">SECONDS</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>MINUTE</em></td>
<td rowspan="1" colspan="1">Minutes</td>
<td rowspan="1" colspan="1">MINUTES</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>HOUR</em></td>
<td rowspan="1" colspan="1">Hours</td>
<td rowspan="1" colspan="1">HOURS</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>DAY</em></td>
<td rowspan="1" colspan="1">Days</td>
<td rowspan="1" colspan="1">DAYS</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>MONTH</em></td>
<td rowspan="1" colspan="1">Months</td>
<td rowspan="1" colspan="1">MONTHS</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>YEAR</em></td>
<td rowspan="1" colspan="1">Years</td>
<td rowspan="1" colspan="1">YEARS</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>MINUTE_SECOND</em></td>
<td rowspan="1" colspan="1">Minutes and seconds</td>
<td rowspan="1" colspan="1">&#8220;MINUTES:SECONDS&#8221;</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>HOUR_MINUTE</em></td>
<td rowspan="1" colspan="1">Hours and minutes</td>
<td rowspan="1" colspan="1">&#8220;HOURS:MINUTES&#8221;</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>DAY_HOUR</em></td>
<td rowspan="1" colspan="1">Days and hours</td>
<td rowspan="1" colspan="1">&#8220;DAYS HOURS&#8221;</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>YEAR_MONTH</em></td>
<td rowspan="1" colspan="1">Years and months</td>
<td rowspan="1" colspan="1">&#8220;YEARS-MONTHS&#8221;</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>HOUR_SECOND</em></td>
<td rowspan="1" colspan="1">Hours, minutes, seconds</td>
<td rowspan="1" colspan="1">&#8220;HOURS:MINUTES:SECONDS&#8221;</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>DAY_MINUTE</em></td>
<td rowspan="1" colspan="1">Days, hours, minutes</td>
<td rowspan="1" colspan="1">&#8220;DAYS HOURS:MINUTES&#8221;</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>DAY_SECOND</em></td>
<td rowspan="1" colspan="1">Days, hours, minutes, seconds</td>
<td rowspan="1" colspan="1">&#8220;DAYSHOURS:MINUTES:SECONDS&#8221;</td>
</tr>
</tbody>
</table>
<p><a name="_Toc484170298"></a>Example</p>
<p>This example extracts dateparts from several datetime values:</p>
<pre><code>/* On MySQL */</code>
<code>SELECT EXTRACT(YEAR FROM "2013-07-02");</code>
<code>-&gt; 1999</code>
<code>SELECT EXTRACT(YEAR_MONTH FROM "2013-07-02 01:02:03");</code>
<code>-&gt; 199907</code>
<code>SELECT EXTRACT(DAY_MINUTE FROM "2013-07-02 01:02:03");</code>
<code>-&gt; 20102</code></pre>
<p><a name="_Toc484170299"></a>POSITION</p>
<p>The <em>POSITION</em> function returns an integer that indicates the starting position of a string within the search string. MySQL and PostgreSQL support the<em>POSITION</em> function with no variation from the SQL99 syntax. PostgreSQL has a synonymous function, <em>TEXTPOS,</em> while MySQL has the synonymous function, <em>LOCATE</em>.</p>
<p>Oracle&#8217;s equivalent function is called <em>INSTR</em>. Microsoft SQL Server has both <em>CHARINDEX</em> and <em>PATINDEX</em>. The <em>CHARINDEX</em> and <em>PATINDEX</em>are very similar, except that <em>PATINDEX</em> allows the use of wildcard characters in the search criteria. For example:</p>
<pre><code>/* On MySQL */</code>
<code>SELECT LOCATE('bar', 'foobar');</code>
<code>-&gt; 4</code>
<code> </code>
<code>/* On MySQL and PostgreSQL */</code>
<code>SELECT POSITION('fu' IN 'snafhu');</code>
<code>-&gt; 0</code>
<code> </code>
<code>/* On Microsoft SQL Server */</code>
<code>SELECT CHARINDEX( 'de', 'abcdefg' )</code>
<code>GO</code>
<code>-&gt; 4</code>
<code>SELECT PATINDEX( '%fg', 'abcdefg' )</code>
<code>GO</code>
<code>-&gt; 6</code></pre>
<h3>String Functions</h3>
<p>Basic string functions offer a number of capabilities and return a string value as a result set. Some string functions are dyadic, indicating that they operate on two strings at once. SQL99 supports the string functions listed in.</p>
<table border="1">
<caption><strong><a name="27402"></a></strong><strong>SQL String Functions</strong></caption>
<tbody>
<tr>
<th rowspan="1" colspan="1"><em>Function</em></th>
<th rowspan="1" colspan="1">Usage</th>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>CONCATENATE<br />
(expression || expression)</em></td>
<td rowspan="1" colspan="1">Appends two or more literal expressions, column values, or variables together into one string.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>CONVERT</em></td>
<td rowspan="1" colspan="1">Converts a string to a different representation within the same character set.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>LOWER</em></td>
<td rowspan="1" colspan="1">Converts a string to all lowercase characters.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>SUBSTRING</em></td>
<td rowspan="1" colspan="1">Extracts a portion of a string.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>TRANSLATE</em></td>
<td rowspan="1" colspan="1">Converts a string from one character set to another.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>TRIM</em></td>
<td rowspan="1" colspan="1">Removes leading characters, trailing characters, or both from a character string.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>UPPER</em></td>
<td rowspan="1" colspan="1">Converts a string to all uppercase characters.</td>
</tr>
</tbody>
</table>
<p>CONCATENATE</p>
<p>SQL99 defines a concatenation operator ( || ), which joins two distinct strings into one string value. The <em>CONCATENATE</em> function appends two or more strings together, producing a single output string. PostgreSQL and Oracle support the double-pipe concatenation operator. Microsoft SQL Server uses the plus sign (+) concatenation operator.</p>
<p>MySQL supports a similar function, <em>CONCAT( )</em>. Refer to the &#8220;Concatenation Operators&#8221; section <em>Chapter 3, </em><cite>SQL Statements Command Reference</cite>, for more information on concatenation within Oracle, PostgreSQL, and Microsoft SQL Server.</p>
<p><a name="_Toc484170302"></a>SQL99 Syntax</p>
<pre><code>CONCATENATE('string1' || 'string2')</code></pre>
<p><a name="_Toc484170303"></a>MySQL Syntax</p>
<pre><code>CONCAT(str1, str2, [,...n])</code></pre>
<p>If any of the concatenation values are null, the entire returned string is null. Also, if a numeric value is concatenated, it is implicitly converted to a character string:</p>
<pre><code>SELECT CONCAT('My ', 'bologna ', 'has ', 'a ', 'first ', 'name...');</code>
<code>-&gt; 'My bologna has a first name...'</code>
<code>SELECT CONCAT('My ', NULL, 'has ', 'first ', 'name...');</code>
<code>-&gt; NULL</code></pre>
<p><a name="_Toc484170304"></a>CONVERT and TRANSLATE</p>
<p>The <em>CONVERT</em> function alters the representation of a character string within its character set and collation. For example, <em>CONVERT</em> might be used to alter the number of bits per character.</p>
<p><em>TRANSLATE</em> alters the character set of a string value from one base-character set to another. Thus, <em>TRANSLATE</em> might be used to translate a value from the English character set to a Kanji (Japanese) or Russian character set. The translation must already exist, either by default or having been created using the <em>CREATE TRANSLATION </em>command.</p>
<p>SQL99 Syntax</p>
<pre><code>CONVERT (char_value target_char_set USING form_of_use source_char_name)</code>
<code> </code>
<code>TRANSLATE(char_value target_char_set USING translation_name)</code></pre>
<p>Among the database vendors, only Oracle supports <em>CONVERT</em> and <em>TRANSLATE</em> with the same meaning as SQL99. Oracle&#8217;s implementation of<em>TRANSLATE</em> is very similar to SQL99, but not identical. In its implementation, Oracle accepts only two arguments and allows translating only between the database character set or the national language support character set.</p>
<p>MySQL&#8217;s implementation of the <em>CONVERT</em> function only translates numbers from one base to another. In contrast, Microsoft SQL Server&#8217;s implementation of <em>CONVERT</em> is a very rich utility that alters the base datatype of an expression, but is otherwise dissimilar to the SQL99 <em>CONVERT</em>function. PostgreSQL does not support <em>CONVERT</em>, and its implementation of <em>TRANSLATE</em> serves to morph any occurrence of a character string to any other character string.</p>
<p><a name="_Toc484170306"></a>MySQL Syntax and Variations</p>
<pre><code>CONV(int, from_base, to_base)</code></pre>
<p>MySQL does not support <em>TRANSLATE</em>. This implementation of <em>CONVERT</em> returns a string value representing the number as it is converted from the<em>from_base</em> value to the <em>to_base</em> value. If any of the numbers are NULL, then the function returns NULL. Following are some examples:</p>
<pre><code>SELECT CONV("a",16,2);</code>
<code>-&gt; '1010'</code>
<code>SELECT CONV("6E",18,8);</code>
<code>-&gt; '172'</code>
<code>SELECT CONV(-17,10,-18);</code>
<code>-&gt; '-H'</code></pre>
<p><a name="_Toc484170307"></a>Microsoft SQL Server Syntax and Variations</p>
<pre><code>CONVERT (data_type[(length) | (precision,scale)], expression[,style])</code></pre>
<p>Microsoft SQL Server does not support <em>TRANSLATE</em>. Microsoft&#8217;s implementation of the <em>CONVERT</em> function does not follow the SQL99 specification. Instead, it is functionally equivalent to the <em>CAST</em> function. The <em>style</em> clause is used to define the format of a date conversion. Refer to the vendor documentation for more information. Following is an example:</p>
<pre><code><em>SELECT title, CONVERT(char(7), ytd_sales)</em></code>
<code><em>FROM titles</em></code>
<code><em>ORDER BY title</em></code>
<code><em>GO</em></code>
<code><em> </em></code></pre>
<h2>Vendor Extensions</h2>
<p>The following section provides a full listing and description of each vendor-supported function. These functions are vendor-specific. Thus, a MySQL function, for example, is not guaranteed to be supported by any other vendor. MySQL functions are provided to give an idea of the capabilities available within the various products. Refer to the vendor&#8217;s documentation for exact syntax usage.</p>
<h3>Microsoft SQL Server-Supported Functions</h3>
<p>provides an alphabetical listing of Microsoft SQL Server-supported functions.</p>
<table border="1">
<caption><strong>Microsoft SQL Server-Supported Functions</strong><strong><a name="65646"></a></strong></caption>
<tbody>
<tr>
<th rowspan="1" colspan="1"><em>Function</em></th>
<th rowspan="1" colspan="1">Description</th>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>abs(numeric_expression)</em></td>
<td rowspan="1" colspan="1">Returns absolute value.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>acos( float_expression)</em></td>
<td rowspan="1" colspan="1">Returns angle (in radians) whose cosine is the specified argument.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>app_name( )</em></td>
<td rowspan="1" colspan="1">Returns application name for current session; set by application.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>ascii(character_expression)</em></td>
<td rowspan="1" colspan="1">Converts character to a numeric ASCII code.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>asin( float_expression)</em></td>
<td rowspan="1" colspan="1">Returns angle (in radians) whose sine is the specified argument.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>atan( float_expression)</em></td>
<td rowspan="1" colspan="1">Returns angle (in radians) whose tangent is the specified argument.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>atn2( float_expression, float_expressioin)</em></td>
<td rowspan="1" colspan="1">Returns angle (in radians) whose tangent is<br />
argument1/argument1.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>avg([ All| Distinct] Expression)</em></td>
<td rowspan="1" colspan="1">Computes average of a column.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>binary_checksum(* | expression [,...n])</em></td>
<td rowspan="1" colspan="1">Returns binary checksum for list of expressions or row of a table.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>cast(Expression as<br />
Data Type)</em></td>
<td rowspan="1" colspan="1">Converts a valid SQL Server expression to the specified datatype.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>ceiling(numeric_expression)</em></td>
<td rowspan="1" colspan="1">Returns smallest integer greater than or equal to the argument.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>char(integer_expression)</em></td>
<td rowspan="1" colspan="1">Converts a numeric ASCII code to a character.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>charindex(expression1, expression2 [, start_location])</em></td>
<td rowspan="1" colspan="1">Returns position of the first occurrence of a substring in a string.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>checksum(* |<br />
expression [,...n])</em></td>
<td rowspan="1" colspan="1">Returns checksum value (computed over row values or expressions provided).</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>checksum_agg([ALL | Distinct] expression)</em></td>
<td rowspan="1" colspan="1">Returns checksum of the values in group.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>coalesce(expression [,...n])</em></td>
<td rowspan="1" colspan="1">Returns the first non-NULL argument from a list of arguments.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>col_length(`table&#8217;, `column&#8217;)</em></td>
<td rowspan="1" colspan="1">Returns column length in bytes.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>col_name(table_id, column_id)</em></td>
<td rowspan="1" colspan="1">Returns column name, given table ID and column ID.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>contains({column | }, `contains_search_condition&#8217;})</em></td>
<td rowspan="1" colspan="1">Searches columns on exact or &#8220;fuzzy&#8221; matches of <em>contains_seach_criteria</em>. It is an elaborate function used to perform full-text searches. Refer to the vendor documentation for more information.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>containsable(table, column, contains_search_condition)</em></td>
<td rowspan="1" colspan="1">Returns a table with exact and &#8220;fuzzy&#8221; matches of <em>contains_search_condition</em>. It is an elaborate function used to perform full-text searches. Refer to the vendor documentation for more information.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>convert(data_type [(length)], expression<br />
[, style])</em></td>
<td rowspan="1" colspan="1">Converts data from one datatype to another.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>cos(float_expression)</em></td>
<td rowspan="1" colspan="1">Returns cosine.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>cot(float_expression)</em></td>
<td rowspan="1" colspan="1">Returns cotangent.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>count({[All |<br />
Distinct] expression]| *})</em></td>
<td rowspan="1" colspan="1">Counts rows.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>count(*)</em></td>
<td rowspan="1" colspan="1">Computes the number of rows, including those with NULL values.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>count( DISTINCT expression )</em></td>
<td rowspan="1" colspan="1">Calculates the number of distinct non-NULL values in a column or expression. Each group of rows with the same value of <em>expression </em>adds 1 to the result.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>count( expression )</em></td>
<td rowspan="1" colspan="1">Returns the number of rows with non-NULL values in a certain column or expression.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>count_big([All | Distinct] expression)</em></td>
<td rowspan="1" colspan="1">Same as <em>count</em> except returns big integer.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>current_timestamp</em></td>
<td rowspan="1" colspan="1">Returns current date and time.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>current_user</em></td>
<td rowspan="1" colspan="1">Returns username in the current database of the current session.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>datalength(expression)</em></td>
<td rowspan="1" colspan="1">Returns number of bytes in a character or binary string.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>databasepropertyex(database, property)</em></td>
<td rowspan="1" colspan="1">Returns database option or property.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>dateadd(datepart, number, date)</em></td>
<td rowspan="1" colspan="1">Adds a number of dateparts (e.g., days) to a datetime value.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>datediff(datepart, startdate, enddate)</em></td>
<td rowspan="1" colspan="1">Calculates difference between two datetime values expressed in certain dateparts.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>datename(datepart, date)</em></td>
<td rowspan="1" colspan="1">Returns name of a datepart (e.g., month) of a datetime argument.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>datepart(datepart, date)</em></td>
<td rowspan="1" colspan="1">Returns value of a datepart (e.g., hour) of a datetime argument.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>day(date)</em></td>
<td rowspan="1" colspan="1">Returns an integer value representing the day of the date provided as a parameter.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>db_id(`[database_name]&#8216;)</em></td>
<td rowspan="1" colspan="1">Returns database ID and given name.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>db_name(database_id)</em></td>
<td rowspan="1" colspan="1">Returns the database name.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>degrees(numeric_expression)</em></td>
<td rowspan="1" colspan="1">Converts radians to degrees.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>difference(character_expression, character_expression)</em></td>
<td rowspan="1" colspan="1">Compares how two arguments sound and returns a number from 0 to 4. Higher result indicates better phonetic match.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>exp(float_expression)</em></td>
<td rowspan="1" colspan="1">Returns exponential value.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>floor(numeric_expression)</em></td>
<td rowspan="1" colspan="1">Returns largest integer less than or equal to the argument.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>file_id(`file_name&#8217;)</em></td>
<td rowspan="1" colspan="1">Returns the file ID for the logical filename.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>file_name(file_id)</em></td>
<td rowspan="1" colspan="1">Returns the logical filename for file ID.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>filegroup_id<br />
(`filegroup_name&#8217;)</em></td>
<td rowspan="1" colspan="1">Returns filegroup ID for the logical filegroup name.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>filegroup_name<br />
(filegroup_id)</em></td>
<td rowspan="1" colspan="1">Returns the logical filegroup name for filegroup ID.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>filegroupproperty<br />
(filegroup_name, property)</em></td>
<td rowspan="1" colspan="1">Returns filegroup property value for the specified property.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>fileproperty<br />
(file, property)</em></td>
<td rowspan="1" colspan="1">Returns file property value for the specified property.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>fulltextcatalog<br />
property(catalog_name, property)</em></td>
<td rowspan="1" colspan="1">Returns full-text catalog properties.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>fulltextservice<br />
property(property)</em></td>
<td rowspan="1" colspan="1">Returns full-text service level properties.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>formatmessage<br />
(msg_number, param_value [,... n ])</em></td>
<td rowspan="1" colspan="1">Constructs a message from an existing message in <strong>SYSMESSAGES</strong> table (similar to RAISERROR).</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>freetexttable(table<br />
{ column |*}, `freetext_string&#8217; [, top_n_by_rank])</em></td>
<td rowspan="1" colspan="1">Used for full-text search; returns a table with columns that match the meaning but don&#8217;t exactly match value of<em>freetext_string</em>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>getdate( )</em></td>
<td rowspan="1" colspan="1">Returns current date and time.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>getansinull([`database'])</em></td>
<td rowspan="1" colspan="1">Returns default nullability setting for new columns.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>getutcdate( )</em></td>
<td rowspan="1" colspan="1">Returns Universal Time Coordinate (UTC) date.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>grouping(column_name)</em></td>
<td rowspan="1" colspan="1">Returns 1 when the row is added by CUBE or ROLLUP; otherwise, returns 0.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>host_id( )</em></td>
<td rowspan="1" colspan="1">Returns workstation ID of a given process.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>host_name( )</em></td>
<td rowspan="1" colspan="1">Returns process hostname.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>ident_incr<br />
(`table_or_view&#8217;)</em></td>
<td rowspan="1" colspan="1">Returns identity-column increment value.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>ident_seed<br />
(`table_or_view&#8217;)</em></td>
<td rowspan="1" colspan="1">Returns identity seed value.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>ident_current<br />
(`table_name&#8217;)</em></td>
<td rowspan="1" colspan="1">Returns the last identity value generated for the specified table.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>identity(data_type [, seed, increment]) As column_name</em></td>
<td rowspan="1" colspan="1">Used in <em>SELECT INTO</em> statement to insert an identity column into the destination table.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>index_col(`table&#8217;,<br />
index_id, key_id)</em></td>
<td rowspan="1" colspan="1">Returns index column name, given table ID, index ID, and column sequential number in the index key.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>indexproperty(table_id, index, property)</em></td>
<td rowspan="1" colspan="1">Returns index property (such as Fillfactor).</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>isdate(expression)</em></td>
<td rowspan="1" colspan="1">Validates if a character string can be converted to DATETIME.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>is_member({`group&#8217; | `role&#8217;})</em></td>
<td rowspan="1" colspan="1">Returns true or false (1 or 0) depending on whether user is a member of NT group or SQL Server role.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>is_srvrolemember<br />
(`role&#8217; [,'login'])</em></td>
<td rowspan="1" colspan="1">Returns true or false (1 or 0) depending on whether user is a member of specified server role.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>isnull(check_expression, replacement_value)</em></td>
<td rowspan="1" colspan="1">Returns the first argument if it is not NULL; otherwise, returns the second argument.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>isnumeric(expression)</em></td>
<td rowspan="1" colspan="1">Validates if a character string can be converted to NUMERIC.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>left(character_expression, integer_expression)</em></td>
<td rowspan="1" colspan="1">Returns a portion of a character expression, starting at <em>integer_expression</em> from left.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>len(string_expression)</em></td>
<td rowspan="1" colspan="1">Returns the number of characters in the expression.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>log(float_expression)</em></td>
<td rowspan="1" colspan="1">Returns natural logarithm.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>log10(float_expression)</em></td>
<td rowspan="1" colspan="1">Returns base-10 logarithm.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>lower(character_expression)</em></td>
<td rowspan="1" colspan="1">Converts a string to lowercase.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>ltrim(character_expression)</em></td>
<td rowspan="1" colspan="1">Trims leading-space characters.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>max([All | Distinct] expression)</em></td>
<td rowspan="1" colspan="1">Finds maximum value in a column.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>min([All | Distinct] expression)</em></td>
<td rowspan="1" colspan="1">Finds minimum value in a column.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>month(date)</em></td>
<td rowspan="1" colspan="1">Returns month part of the date provided.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>nchar(integer_expression)</em></td>
<td rowspan="1" colspan="1">Returns the unicode character with the given integer code.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>newid( )</em></td>
<td rowspan="1" colspan="1">Creates a new unique identifier of type <em>uniqueidentifier</em>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>nullif(expression, expression)</em></td>
<td rowspan="1" colspan="1">Returns NULL if two specified expressions are equivalent.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>object_id(`object&#8217;)</em></td>
<td rowspan="1" colspan="1">Returns object ID and given name.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>object_name(object_id)</em></td>
<td rowspan="1" colspan="1">Returns object name and given ID.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>objectproperty<br />
(id, property)</em></td>
<td rowspan="1" colspan="1">Returns properties of objects in the current database.</td>
</tr>
</tbody>
</table>
<h3>MySQL-Supported Functions</h3>
<p>provides an alphabetical listing of MySQL-supported functions.</p>
<table border="1">
<caption><strong>MySQL-Supported Functions</strong><strong><a name="39306"></a></strong></caption>
<tbody>
<tr>
<th rowspan="1" colspan="1">Function</th>
<th rowspan="1" colspan="1">Description</th>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>abs(X)</em></td>
<td rowspan="1" colspan="1">Returns the absolute value of <em>X</em>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>acos(X)</em></td>
<td rowspan="1" colspan="1">Returns the arc cosine of <em>X</em>, i.e., the value whose cosine is <em>X</em>; returns NULL if <em>X</em> is not in the range -1 to 1.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>ascii(str)</em></td>
<td rowspan="1" colspan="1">Returns the ASCII code value of the leftmost character of the string <em>str</em>; returns 0 if <em>str</em> is the empty string; returns NULL if <em>str</em> is NULL.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>asin(X)</em></td>
<td rowspan="1" colspan="1">Returns the arc sine of <em>X</em>, i.e., the value whose sine is <em>X</em>; returns NULL if <em>X</em> is not in the range -1 to 1.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>atan(X)</em></td>
<td rowspan="1" colspan="1">Returns the arctangent of <em>X</em>, i.e., the value whose tangent is <em>X</em>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>atan2(X,Y)</em></td>
<td rowspan="1" colspan="1">Returns the arctangent of the two variables <em>X</em> and <em>Y</em>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>avg(expr)</em></td>
<td rowspan="1" colspan="1">Returns the average value of <em>expr.</em></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>benchmark(count,expr)</em></td>
<td rowspan="1" colspan="1">Executes the expression <em>expr</em> <em>count</em> times. It may be used to time how fast MySQL processes the expression. The result value is always 0.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>binary</em></td>
<td rowspan="1" colspan="1">Casts the string following it to a binary string.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>bin(N)</em></td>
<td rowspan="1" colspan="1">Returns a string representation of the binary value of <em>N</em>, where <em>N</em> is a long (<em>BIGINT </em>) number.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>bit_count(N)</em></td>
<td rowspan="1" colspan="1">Returns the number of bits that are set in the argument <em>N.</em></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>bit_and(expr)</em></td>
<td rowspan="1" colspan="1">Returns the bitwise <em>AND</em> of all bits in <em>expr</em>. The calculation is performed with 64-bit (<em>BIGINT </em>) precision.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>bit_or(expr)</em></td>
<td rowspan="1" colspan="1">Returns the bitwise <em>OR</em> of all bits in <em>expr</em>. The calculation is performed with 64-bit (<em>BIGINT </em>) precision.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>CASE value WHEN [compare-value] THEN result [WHEN [compare-value] THEN result &#8230;] [ELSE result] END</em><em>CASE WHEN [condition] THEN result [WHEN [condition] THEN result &#8230;] [ELSE result] END</em></td>
<td rowspan="1" colspan="1">The first version returns the result where <em>value=compare-value</em>. The second version returns the result for the first condition that is true.If there is no matching result value, then the result after <em>ELSE</em> is returned. If there is no <em>ELSE</em> part, NULL is returned.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>ceiling(X)</em></td>
<td rowspan="1" colspan="1">Returns the smallest integer value not less than <em>X</em>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>char(N,&#8230;)</em></td>
<td rowspan="1" colspan="1">Interprets the arguments as integers and returns a string consisting of the characters given by the ASCII code values of those integers. NULL values are skipped.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>coalesce(list)</em></td>
<td rowspan="1" colspan="1">Returns first non-NULL element in the list.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>concat(str1,str2,&#8230;)</em></td>
<td rowspan="1" colspan="1">Returns the string that results from concatenating the arguments.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>concat_ws(separator, str1, str2,&#8230;)</em></td>
<td rowspan="1" colspan="1">Stands for CONCAT With Separator and is a special form of <em>CONCAT( ).</em> The first argument is the separator for the rest of the arguments. The separator and the rest of the arguments can be a string. If the separator is NULL, the result is NULL. The function skips any NULLs and empty strings after the separator argument. The separator is added between the strings to be concatenated.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>connection_id( )</em></td>
<td rowspan="1" colspan="1">Returns the connection ID (<em>thread_id </em>) for the connection. Every connection has its own unique ID.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>conv(N,from_base,to_base)</em></td>
<td rowspan="1" colspan="1">Converts numbers between different number bases; returns a string representation of the number <em>N</em>, converted from base <em>from_base</em> to base <em>to_base</em> ; returns NULL if any argument is NULL.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>cos(X)</em></td>
<td rowspan="1" colspan="1">Returns the cosine of <em>X</em>, where <em>X</em> is given in radians.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>cot(X)</em></td>
<td rowspan="1" colspan="1">Returns the cotangent of <em>X</em>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>count(DISTINCT expr,[expr...])</em></td>
<td rowspan="1" colspan="1">Returns a count of the number of different values.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>count(expr)</em></td>
<td rowspan="1" colspan="1">Returns a count of the number of non-NULL values in the rows retrieved by a <em>SELECT</em> statement.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>curdate( )</em><em>current_date</em></td>
<td rowspan="1" colspan="1">Returns today&#8217;s date as a value in `YYYY-MM-DD&#8217; or YYYYMMDD format, depending on whether the function is used in a string or numeric context.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>curtime( )</em><em>current_time</em></td>
<td rowspan="1" colspan="1">Returns the current time as a value in `HH:MM:SS&#8217; or HHMMSS format, depending on whether the function is used in a string or numeric context.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>database( )</em></td>
<td rowspan="1" colspan="1">Returns the current database name.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>date_add(date,INTERVAL expr type)</em><em>date_sub(date,INTERVAL expr type)</em><em>adddate(date,INTERVAL expr type)</em><em>subdate(date,INTERVAL expr type)</em></td>
<td rowspan="1" colspan="1">These functions perform date arithmetic. <em>ADDDATE( )</em> and <em>SUBDATE( )</em> are synonyms for <em>DATE_ADD( )</em>and <em>DATE_<br />
SUB( ). date</em> is a <em>DATETIME</em> or <em>DATE</em> value specifying the starting date. <em>expr</em> is an expression specifying the interval value to be added or subtracted from the starting date. <em>expr</em> may start with a &#8211; for negative intervals. <em>type</em> indicates how the expression should be interpreted.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>date_ format<br />
(date, format)</em></td>
<td rowspan="1" colspan="1">Formats the date value according to the format string.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>dayname(date)</em></td>
<td rowspan="1" colspan="1">Returns the name of the weekday for date.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>dayofmonth(date)</em></td>
<td rowspan="1" colspan="1">Returns the day of the month for date, in the range 1 to 31.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>dayofweek(date)</em></td>
<td rowspan="1" colspan="1">Returns the weekday index for date (1 = Sunday, 2 = Monday, . . . 7 = Saturday).</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>dayofyear(date)</em></td>
<td rowspan="1" colspan="1">Returns the day of the year for date, in the range 1 to 366.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>decode(crypt_str,<br />
pass_str)</em></td>
<td rowspan="1" colspan="1">Decrypts the encrypted string <em>crypt_str</em> using <em>pass_str</em> as the password. <em>crypt_str</em> should be a string returned from <em>ENCODE( )</em>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>degrees(X)</em></td>
<td rowspan="1" colspan="1">Returns the argument <em>X</em>, converted from radians to degrees.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>elt(N,str1,str2,str3,&#8230;)</em></td>
<td rowspan="1" colspan="1">Returns <em>str1</em> if <em>N</em> = 1, <em>str2</em> if <em>N</em> = 2, and so on. Returns NULL if <em>N</em> is less than 1 or greater than the number of arguments. <em>ELT( )</em> is the complement of <em>FIELD( )</em>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>encode(str,pass_str)</em></td>
<td rowspan="1" colspan="1">Encrypts <em>str</em> using <em>pass_str</em> as the password. To decrypt the result, use <em>DECODE( ).</em> The result is a binary string the same length as the string.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>encrypt(str[,salt])</em></td>
<td rowspan="1" colspan="1">Encrypts <em>str</em> using the Unix <em>crypt( )</em> system call. The <em>salt</em> argument should be a string with two characters.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>exp(X)</em></td>
<td rowspan="1" colspan="1">Returns the value of <em>e</em> (the base of natural logarithms) raised to the power of <em>X</em>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>export_set<br />
(bits,on,off,[separator,<br />
[number_of_bits]])</em></td>
<td rowspan="1" colspan="1">Returns a string where every bit set in `bit&#8217; gets an `on&#8217; string and every reset bit gets an `off &#8216; string. Each string is separated with `separator&#8217; (default `,&#8217;) and only `number_of_bits&#8217; (default 64) of `bits&#8217; is used.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>field(str,str1,str2,str3,&#8230;)</em></td>
<td rowspan="1" colspan="1">Returns the index of <em>str</em> in the <em>str1</em>, <em>str2</em>, <em>str3</em>, . . . list. Returns 0 if <em>str</em> is not found. <em>FIELD( )</em> is the complement of <em>ELT( )</em>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>find_in_set(str,strlist)</em></td>
<td rowspan="1" colspan="1">Returns a value 1 to <em>N</em> if the string <em>str</em> is in the list <em>strlist</em> consisting of <em>N</em> substrings. A string list is a string composed of substrings separated by `,&#8217; characters. Returns 0 if <em>str</em> is not in <em>strlist</em> or if <em>strlist</em> is the empty string. Returns NULL if either argument is NULL. This function does not work properly if the first argument contains a `,&#8217;.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>floor(X)</em></td>
<td rowspan="1" colspan="1">Returns the largest integer value not greater than <em>X</em>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>format(X,D)</em></td>
<td rowspan="1" colspan="1">Formats the number <em>X</em> to a format like `#,###,###.##&#8217;, rounded to <em>D</em> decimals. If <em>D</em> is 0, the result has no decimal point or fractional part.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>from_days(N)</em></td>
<td rowspan="1" colspan="1">Given a daynumber <em>N</em>, returns a <em>DATE</em> value. Not intended for use with values that precede the advent of the Gregorian calendar (1582), due to the days lost when the calendar was changed.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>from_unixtime(unix_timestamp)</em></td>
<td rowspan="1" colspan="1">Returns a representation of the <em>unix_timestamp</em> argument as a value in `YYYY-MM-DD HH:MM:SS&#8217; or YYYYMMDDHHMMSS format, depending on whether the function is used in a string or numeric context.</td>
</tr>
<tr>
<td rowspan="1" colspan="1">from_unixtime<em>(unix_timestamp,format)</em></td>
<td rowspan="1" colspan="1">Returns a string representation of the <em>unix_timestamp</em>, formatted according to the format string. Format may contain the same specifiers as those listed in the entry for the <em>DATE_FORMAT( )</em> function.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>get_lock(str,timeout)</em></td>
<td rowspan="1" colspan="1">Tries to obtain a lock with a name given by the string <em>str</em>, with a timeout of <em>timeout</em> seconds. Returns 1 if the lock is obtained successfully, 0 if the attempt times out, or NULL if an error occurs.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>greatest(X,Y,&#8230;)</em></td>
<td rowspan="1" colspan="1">Returns the largest (maximum-valued) argument.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>hex(N)</em></td>
<td rowspan="1" colspan="1">Returns a string representation of the hexadecimal value of <em>N</em>, where <em>N</em> is a long (<em>BIGINT </em>) number. This is equivalent to <em>CONV(N,10,16).</em> Returns NULL if <em>N</em> is NULL.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>interval(N,N1,N2,N3,&#8230;)</em></td>
<td rowspan="1" colspan="1">Returns 0 if <em>N</em> &lt; <em>N1</em>, 1 if <em>N</em> &lt; <em>N2</em>, and so on. All arguments are treated as integers. It is required that <em>N1</em> &lt;<em>N2</em> &lt; <em>N3</em> &lt; . . .<br />
&lt; <em>Nn</em> for this function to work correctly.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>hour(time)</em></td>
<td rowspan="1" colspan="1">Returns the hour for time, in the range 0 to 23.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>if(expr1,expr2,expr3)</em></td>
<td rowspan="1" colspan="1">If <em>expr1</em> is TRUE (<em>expr1</em> &lt;&gt; 0 and <em>expr1</em> &lt;&gt; NULL), then<br />
<em>IF( )</em> returns <em>expr2</em>, else it returns <em>expr3</em>. <em>IF( )</em> returns a numeric or string value, depending on the context in which it is used.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>ifnull(expr1,expr2)</em></td>
<td rowspan="1" colspan="1">If <em>expr1</em> is not NULL, <em>IFNULL( )</em> returns <em>expr1</em>; otherwise it returns <em>expr2</em>. <em>IFNULL( )</em> returns a numeric or string value, depending on the context in which it is used.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>isnull(expr)</em></td>
<td rowspan="1" colspan="1">If <em>expr</em> is NULL, <em>ISNULL( )</em> returns 1; otherwise it returns 0.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>insert(str,pos,len,newstr)</em></td>
<td rowspan="1" colspan="1">Returns the string <em>str</em>. The substring begins at position <em>pos</em> and is 10 characters long, replaced by the string<em>newstr</em>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>instr(str,substr)</em></td>
<td rowspan="1" colspan="1">Returns the position of the first occurrence of substring <em>substr</em> in string <em>str</em>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>last_insert_id([expr])</em></td>
<td rowspan="1" colspan="1">Returns the last automatically generated value that was inserted into an <em>AUTO_INCREMENT</em> column.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>lcase(str)</em><em>lower(str)</em></td>
<td rowspan="1" colspan="1">Returns the string <em>str</em> with all characters changed to lowercase according to the current character-set mapping (default is ISO-8859-1 Latin1).</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>least(X,Y,&#8230;)</em></td>
<td rowspan="1" colspan="1">With two or more arguments, returns the smallest (minimum-valued) argument.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>left(str,len)</em></td>
<td rowspan="1" colspan="1">Returns the leftmost <em>len</em> characters from the string <em>str</em>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>length(str)</em><em>octet_length(str)</em><em>char_length(str)</em><em>character_length(str)</em></td>
<td rowspan="1" colspan="1">These functions return the length of the string <em>str</em>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>load_ file(file_name)</em></td>
<td rowspan="1" colspan="1">Reads the file and returns the file contents as a string. The file must be on the server, and the user must specify the full pathname to the file and have the file privilege.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>locate(substr,str)</em><em>position(substr IN str)</em></td>
<td rowspan="1" colspan="1">Returns the position of the first occurrence of substring <em>substr</em> in string <em>str</em>. Returns 0 if <em>substr</em> is not in <em>str</em>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>locate(substr,str,pos)</em></td>
<td rowspan="1" colspan="1">Returns the position of the first occurrence of substring <em>substr</em> in string <em>str</em>, starting at position <em>pos</em>; returns 0 if <em>substr</em> is not in <em>str</em>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>log(X)</em></td>
<td rowspan="1" colspan="1">Returns the natural logarithm of <em>X</em>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>log10(X)</em></td>
<td rowspan="1" colspan="1">Returns the base-10 logarithm of <em>X</em>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>lpad(str,len,padstr)</em></td>
<td rowspan="1" colspan="1">Returns the string <em>str</em>, left-padded with the string <em>padstr</em> until <em>str</em> is 10 characters long.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>ltrim(str)</em></td>
<td rowspan="1" colspan="1">Returns the string <em>str</em> with leading-space characters removed.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>make_set(bits,str1,str2, . . . )</em></td>
<td rowspan="1" colspan="1">Returns a set (a string containing substrings separated by `,&#8217; characters) consisting of the strings that have the corresponding bits in bit set. <em>str1</em> corresponds to bit 0, <em>str2</em> to bit 1, etc. NULL strings in <em>str1, str2,</em> . . . are not appended to the result.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>md5(string)</em></td>
<td rowspan="1" colspan="1">Calculates a MD5 <em>checksum</em> for the string. Value is returned as a 32-long hex number.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>min(expr)</em><em>max(expr)</em></td>
<td rowspan="1" colspan="1">Returns the minimum or maximum value of <em>expr</em>. <em>MIN( ) </em>and<em> MAX( )</em> may take a string argument; in such cases they return the minimum or maximum string value.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>minute(time)</em></td>
<td rowspan="1" colspan="1">Returns the minute for time, in the range 0 to 59.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>mod(N,M)</em></td>
<td rowspan="1" colspan="1">% Modulo (like the % operator in C); returns the remainder of <em>N</em> divided by <em>M</em>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>month(date)</em></td>
<td rowspan="1" colspan="1">Returns the month for date, in the range 1 to 12.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>monthname(date)</em></td>
<td rowspan="1" colspan="1">Returns the name of the month for date.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>now( )</em><em>sysdate( )</em><em>current_timestamp</em></td>
<td rowspan="1" colspan="1">Returns the current date and time as a value in `YYYY-MM-DD HH:MM:SS&#8217; or YYYYMMDDHHMMSS format, depending on whether the function is used in a string or numeric context.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>nullif(expr1,expr2)</em></td>
<td rowspan="1" colspan="1">If <em>expr1 = expr2 </em>is true, returns NULL; otherwise returns <em>expr1</em>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>oct(N)</em></td>
<td rowspan="1" colspan="1">Returns a string representation of the octal value of <em>N</em>, where <em>N</em> is a long number. This is equivalent to<em>CONV(N,10,8).</em> Returns NULL if <em>N</em> is NULL.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>ord(str)</em></td>
<td rowspan="1" colspan="1">If the leftmost character of the string <em>str</em> is a multibyte character, returns the code of multibyte character by returning the ASCII code value of the character in the format of:<code>((first byte ASCII code)*256+(second byte ASCII code))[*256+third byte ASCII code...]</code>If the leftmost character is not a multibyte character, returns the same value as the <em>ASCII( )</em> function does.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>password(str)</em></td>
<td rowspan="1" colspan="1">Calculates a password string from the plain-text password <em>str</em>. This is the function that is used for encrypting MySQL passwords for storage in the <strong>Password</strong> column of the user grant table.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>period_add(P,N)</em></td>
<td rowspan="1" colspan="1">Adds <em>N</em> months to period <em>P</em> (in the format YYMM or YYYYMM). Returns a value in the format YYYYMM. Note that the period argument <em>P</em> is not a date value.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>period_diff(P1,P2)</em></td>
<td rowspan="1" colspan="1">Returns the number of months between periods <em>P1</em> and <em>P2</em>. <em>P1</em> and <em>P2</em> should be in the format YYMM or YYYYMM. Note that the period arguments <em>P1</em> and <em>P2</em> are not date values.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>pi( )</em></td>
<td rowspan="1" colspan="1">Returns the value of <em><img src="http://oreilly.com/catalog/sqlnut/chapter/pi.gif" alt="" /></em>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>pow(X,Y)</em><em>power(X,Y)</em></td>
<td rowspan="1" colspan="1">Returns the value of <em>X</em> raised to the power of <em>Y</em>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>quarter(date)</em></td>
<td rowspan="1" colspan="1">Returns the quarter of the year for date, in the range 1 to 4.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>radians(X)</em></td>
<td rowspan="1" colspan="1">Returns the argument <em>X</em>, converted from degrees to radians.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>rand( )</em><em>rand(N)</em></td>
<td rowspan="1" colspan="1">Returns a random floating-point value in the range 0 to 1.0.If an integer argument <em>N</em> is specified, it is used as the seed value.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>release_lock(str)</em></td>
<td rowspan="1" colspan="1">Releases the lock named by the string <em>str</em> that was obtained with <em>GET_LOCK( ).</em> Returns 1 if the lock is released, 0 if the lock isn&#8217;t locked by this thread (in which case the lock is not released), and NULL if the named lock doesn&#8217;t exist.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>repeat(str,count)</em></td>
<td rowspan="1" colspan="1">Returns a string consisting of the string <em>str</em> repeated <em>count</em> times. If <em>count</em> &lt;= 0, returns an empty string. Returns NULL if <em>str</em> or <em>count</em> are NULL.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>replace(str, from_str,to_str)</em></td>
<td rowspan="1" colspan="1">Returns the string <em>str</em> with all occurrences of the string <em>from_str</em> replaced by the string <em>to_str</em>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>reverse(str)</em></td>
<td rowspan="1" colspan="1">Returns the string <em>str</em> with the order of the characters reversed.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>right(str,ten)</em></td>
<td rowspan="1" colspan="1">Returns the rightmost 10 characters from the string <em>str</em>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>round(X)</em></td>
<td rowspan="1" colspan="1">Returns the argument <em>X</em>, rounded to an integer.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>round(X,D)</em></td>
<td rowspan="1" colspan="1">Returns the argument <em>X</em>, rounded to a number with <em>D</em> decimals. If <em>D</em> is 0, the result has no decimal point or fractional part.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>rpad(str,len,padstr)</em></td>
<td rowspan="1" colspan="1">Returns the string <em>str</em>, right-padded with the string <em>padstr</em> until <em>str</em> is ten characters long.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>rtrim(str)</em></td>
<td rowspan="1" colspan="1">Returns the string <em>str</em> with trailing space characters removed.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>sec_to_time(seconds)</em></td>
<td rowspan="1" colspan="1">Returns the seconds argument, converted to hours, minutes, and seconds, as a value in `HH:MM:SS&#8217; or HHMMSS format, depending on whether the function is used in a string or numeric context.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>second(time)</em></td>
<td rowspan="1" colspan="1">Returns the second for time, in the range 0 to 59.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>sign(X)</em></td>
<td rowspan="1" colspan="1">Returns the sign of the argument as -1, 0, or 1, depending on whether <em>X</em> is negative, zero, or positive.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>sin(X)</em></td>
<td rowspan="1" colspan="1">Returns the sine of <em>X</em>, where <em>X</em> is given in radians.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>soundex(str)</em></td>
<td rowspan="1" colspan="1">Returns a <em>soundex</em> string from <em>str</em>. Two strings that sound &#8220;about the same&#8221; should have identical <em>soundex</em>strings.A &#8220;standard&#8221; <em>soundex</em> string is four characters long, but the <em>SOUNDEX( )</em> function returns an arbitrarily long string. A <em>SUBSTRING( )</em> can be used on the result to get a &#8220;standard&#8221; <em>soundex</em> string. All non-alphanumeric characters are ignored in the given string. All international alphabetic characters outside the A-Z range are treated as vowels.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>space(N)</em></td>
<td rowspan="1" colspan="1">Returns a string consisting of <em>N</em> space characters.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>sqrt(X)</em></td>
<td rowspan="1" colspan="1">Returns the nonnegative square root of <em>X</em>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>std(expr)</em><em>stddev(expr)</em></td>
<td rowspan="1" colspan="1">Returns the standard deviation of <em>expr</em>. The <em>STDDEV( ) </em>form of this function is provided for Oracle compatability.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>strcmp(expr1,expr2)</em></td>
<td rowspan="1" colspan="1"><em>STRCMP( )</em> returns 0 if the strings are the same, -1 if the first argument is smaller than the second according to the current sort order, and 1 otherwise.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>substring(str,pos,len)</em><em>substring(str FROM<br />
pos FOR len)</em><em>mid(str,pos,len)</em></td>
<td rowspan="1" colspan="1">Returns a substring 10 characters long from string <em>str</em>, starting at position <em>pos</em>. The variant form that uses<em>FROM</em> is ANSI SQL92 syntax.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>substring_index<br />
(str,delim,count)</em></td>
<td rowspan="1" colspan="1">Returns the substring from string <em>str</em> after <em>count</em> occurrences of the delimiter <em>delim</em>. If <em>count</em> is positive, everything to the left of the final delimiter (counting from the left) is returned. If <em>count</em> is negative, everything to the right of the final delimiter (counting from the right) is returned.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>substring(str,pos)</em><em>substring(str FROM pos)</em></td>
<td rowspan="1" colspan="1">Returns a substring from string <em>str</em> starting at position <em>pos</em>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>sum(expr)</em></td>
<td rowspan="1" colspan="1">Returns the sum of <em>expr</em>. Note that if the return set has no rows, it returns NULL.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>tan(X).</em></td>
<td rowspan="1" colspan="1">Returns the tangent of <em>X</em>, where <em>X</em> is given in radians.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>time_ format<br />
(time, format)</em></td>
<td rowspan="1" colspan="1">This is used like <em>DATE_FORMAT( ),</em> but the format string may contain only those format specifiers that handle hours, minutes, and seconds. Other specifiers produce a NULL value or 0.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>time_to_sec(time)</em></td>
<td rowspan="1" colspan="1">Returns the time argument, converted to seconds.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>to_days(date)</em></td>
<td rowspan="1" colspan="1">Given a date, returns a daynumber (the number of days since year 0).</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>trim([[BOTH | LEADING | TRAILING] [remstr] FROM] str)</em></td>
<td rowspan="1" colspan="1">Returns the string <em>str</em> with all <em>remstr</em> prefixes and/or suffixes removed. If none of the specifiers <em>BOTH</em>,<em>LEADING,</em> or <em>TRAILING</em> are given, <em>BOTH</em> is assumed. If <em>remstr</em> is not specified, spaces are removed.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>truncate(X,D)</em></td>
<td rowspan="1" colspan="1">Returns the number <em>X</em>, truncated to <em>D</em> decimals. If <em>D</em> is 0, the result has no decimal point or fractional part.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>ucase(str)</em><em>upper(str)</em></td>
<td rowspan="1" colspan="1">Returns the string <em>str</em> with all characters changed to uppercase according to the current character set mapping (default is ISO-8859-1 Latin1).</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>unix_timestamp( )</em><em>unix_timestamp(date)</em></td>
<td rowspan="1" colspan="1">If called with no argument, returns a Unix timestamp (seconds since `1970-01-01 00:00:00&#8242; GMT). If<em>UNIX_TIMESTAMP( ) </em>is called with a date argument, it returns<br />
the value of the argument as seconds since `1970-01-01 00:00:00&#8242; GMT.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>user( )</em><em>system_user( )</em><em>session_user( )</em></td>
<td rowspan="1" colspan="1">These functions return the current MySQL username.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>version( )</em></td>
<td rowspan="1" colspan="1">Returns a string indicating the MySQL server version.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>week(date)</em><em>week(date, first)</em></td>
<td rowspan="1" colspan="1">With a single argument, returns the week for date, in the range 0 to 53. (The beginning of a week 53 is possible during some years.) The two-argument form of WEEK( ) allows the user to specify whether the week starts on Sunday (0) or Monday (1).</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>weekday(date)</em></td>
<td rowspan="1" colspan="1">Returns the weekday index for date (0 = Monday, 1 = Tuesday, . . . 6 = Sunday).</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>year(date)</em></td>
<td rowspan="1" colspan="1">Returns the year for date, in the range 1000 to 9999.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>yearweek(date)</em><em>yearweek(date, first)</em></td>
<td rowspan="1" colspan="1">Returns year and week for a date. The second argument works exactly like the second argument to<em> WEEK( ).</em> Note that the year may be different from the year in the date argument for the first and the last week of the year.</td>
</tr>
</tbody>
</table>
<h3>Oracle SQL-Supported Functions</h3>
<p>provides an alphabetical listing of the SQL functions specific to Oracle.</p>
<table border="1">
<caption><strong>Oracle-Supported Functions</strong><strong><a name="97789"></a></strong></caption>
<tbody>
<tr>
<th rowspan="1" colspan="1">Function</th>
<th rowspan="1" colspan="1">Description</th>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>abs(number)</em></td>
<td rowspan="1" colspan="1">Returns the absolute value of <em>number.</em></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>acos(number)</em></td>
<td rowspan="1" colspan="1">Returns the arc cosine of <em>number</em> ranging from -1 to 1. The result ranges from 0 to <em><img src="http://oreilly.com/catalog/sqlnut/chapter/pi.gif" alt="" /></em> and is expressed in radians.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>add_months(date, int)</em></td>
<td rowspan="1" colspan="1">Returns the date <em>date </em>plus <em>int</em><em> </em>months.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>ascii(string)</em></td>
<td rowspan="1" colspan="1">Returns the decimal value in the database character set of the first character of <em>string</em>; returns an ASCII value when the database character set is 7-bit ASCII; returns EBCDIC values if the database character set is EBCDIC Code Page 500.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>asin(number)</em></td>
<td rowspan="1" colspan="1">Returns the arc sine of <em>number</em><em> </em>ranging from -1 to 1. The resulting value ranges from <em>-<img src="http://oreilly.com/catalog/sqlnut/chapter/pi.gif" alt="" /></em>/2 to <em><img src="http://oreilly.com/catalog/sqlnut/chapter/pi.gif" alt="" /></em> /2 and is expressed in radians.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>atan(number)</em></td>
<td rowspan="1" colspan="1">Returns the arctangent of any <em>number.</em> The resulting value ranges from <em>-<img src="http://oreilly.com/catalog/sqlnut/chapter/pi.gif" alt="" /></em> /2 to p/2 and is expressed in radians.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>atan2(number,nbr)</em></td>
<td rowspan="1" colspan="1">Returns the arctangent of <em>number</em><em> </em>and <em>nbr</em><em>.</em> The values for <em>number</em> and <em>nbr</em> are not restricted, but the results range from <em>-<img src="http://oreilly.com/catalog/sqlnut/chapter/pi.gif" alt="" /> </em>to <em><img src="http://oreilly.com/catalog/sqlnut/chapter/pi.gif" alt="" /></em> and are expressed in radians.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>avg([DISTINCT ] expression) over (analytics)</em></td>
<td rowspan="1" colspan="1">Returns the average value of <em>expr</em>. It can be used as an aggregate or analytic function (analytic functions are beyond the scope of this text).</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>bfilename(`directory&#8217;,'filename&#8217;)</em></td>
<td rowspan="1" colspan="1">Returns a <em>BFILE</em> locator associated with a physical LOB binary <em>filename</em> on the server&#8217;s filesystem in <em>directory.</em></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>ceil(number)</em></td>
<td rowspan="1" colspan="1">Returns smallest integer greater than or equal to <em>number.</em></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>chartorowid(char)</em></td>
<td rowspan="1" colspan="1">Converts a value from a character datatype (<em>CHAR</em> or <em>VARCHAR2</em> datatype) to <em>ROWID</em> datatype.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>chr(number [USING NCHAR_CS])</em></td>
<td rowspan="1" colspan="1">Returns the character having the binary equivalent to <em>number </em>in either the database character set (if <em>USING NCHAR_CS</em> is not included) or the national character set (if <em>USING NCHAR_CS </em>is included).</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>concat(string1, string2)</em></td>
<td rowspan="1" colspan="1">Returns <em>string1</em><em> </em>concatenated with <em>string2</em>. It is equivalent to the concatenation operator (||).</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>convert(char_value, target_char_set, source_char_set)</em></td>
<td rowspan="1" colspan="1">Converts a character string from one character set to another; returns the <em>char_value</em> in the <em>target_char_set</em> after converting <em>char_value</em> from the <em>source_char_set.</em></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>corr(expression1, expression2) over (analytics)</em></td>
<td rowspan="1" colspan="1">Returns the correlation coefficient of a set of numbered pairs (<em>expressions</em> 1 and 2). It can be used as an aggregate or analytic function (analytic functions are beyond the scope of this text).</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>cos(number)</em></td>
<td rowspan="1" colspan="1">Returns the cosine of <em>number</em> as an angle expressed in radians.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>cosh(number)</em></td>
<td rowspan="1" colspan="1">Returns the hyperbolic cosine of <em>number.</em></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>count</em></td>
<td rowspan="1" colspan="1">Returns the number of rows in the query; refer to the earlier section on <em>COUNT</em> for more information.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>covar_pop(expression1, expression2) over<br />
(analytics)</em></td>
<td rowspan="1" colspan="1">Returns the population covariance of a set of number pairs (<em>expressions</em> 1 and 2). It can be used as an aggregate or analytic function (analytic functions are beyond the scope of this text).</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>covar_samp(expression1, expression2) over(analytics)</em></td>
<td rowspan="1" colspan="1">Returns the sample covariance of a set of number pairs (<em>expressions</em> 1 and 2). It can be used as an aggregate or analytic function (analytic functions are beyond the scope of this text).</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>cume_dist( ) ( [OVER (query)] ORDER BY&#8230;)</em></td>
<td rowspan="1" colspan="1">The cumulative distribution function computes the relative position of a specified value in a group of values.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>decode</em>(expr search , result [,. n] [,default])</td>
<td rowspan="1" colspan="1">Compares <em>expr</em> to the search value; if <em>expr</em> is equal to a search, returns the result. Without a match, <em>DECODE</em>returns default, or <em>NULL</em> if default is omitted. Refer to Oracle documentation for more details.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>dense_rank( ) ( [OVER (query)] ORDER BY&#8230;)</em></td>
<td rowspan="1" colspan="1">Computes the rank of each row returned from a query with respect to the other rows, based on the values of the<em>value_exprs</em> in the <em>ORDER_BY_clause.</em></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>deref(expression)</em></td>
<td rowspan="1" colspan="1">Returns the object reference of <em>expression</em>, where <em>expression</em><em> </em>must return a <em>REF</em> to an object.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>dump(expression [,return_ format [, starting_at [,length]]] )</em></td>
<td rowspan="1" colspan="1">Returns a <em>VARCHAR2 </em>value containing a datatype code, length in bytes, and internal representation of <em>expression</em>. The resulting value is returned in the format of <em>return_ format</em>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>empth[B | C]lob( )</em></td>
<td rowspan="1" colspan="1">Returns an empty LOB locator that can be used to initialize a LOB variable. It can also be used to initialize a LOB column or attribute to empty in an <em>INSERT</em> or <em>UPDATE</em> statement.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>exp(number)</em></td>
<td rowspan="1" colspan="1">Returns <em>E</em> raised to the <em>number </em>ed power, where<br />
E = 2.71828183.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>first_value( expression) over (analytics)</em></td>
<td rowspan="1" colspan="1">Returns the first value in an ordered set of values.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>floor(number)</em></td>
<td rowspan="1" colspan="1">Returns largest integer equal to or less than <em>number.</em></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>greatest(expression [,...n])</em></td>
<td rowspan="1" colspan="1">Returns the greatest of the list of <em>expressions</em>. All <em>expressions</em> after the first are implicitly converted to the datatype of the first <em>expression</em><em> </em>before the comparison.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>grouping(expression)</em></td>
<td rowspan="1" colspan="1">Distinguishes null cause by a super-aggregation in <em>GROUP BY</em> extension from an actual null value.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>hextoraw(string)</em></td>
<td rowspan="1" colspan="1">Converts <em>string</em><em> </em>containing hexadecimal digits into a raw value.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>initcap(string)</em></td>
<td rowspan="1" colspan="1">Returns <em>string</em>, with the first letter of each word in uppercase and all other letters in lowercase.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>instr(string1, string2, start_at, occurrence)</em></td>
<td rowspan="1" colspan="1">Searches one character string for another character string. <em>INSRT</em> search <em>char1</em><em> </em>with a starting position of <em>start_at</em>(an integer) looking for the numeric <em>occurrence</em> within <em>string2</em><em>.</em> Returns the position of the character in <em>string1</em><em> </em>that is the first character of this occurrence.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>instrb(string1, string2, [start_a[t, occurrence]])</em></td>
<td rowspan="1" colspan="1">The same as <em>INSTR</em>, except that <em>start_at</em><em> </em>and the return value are expressed in bytes instead of characters.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>lag(expression [,offset][,default]) over(analytics)</em></td>
<td rowspan="1" colspan="1">Provides access to more than one row of a table at the same time without a self join; refer to the vendor documentation for more information.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>last_day(date)</em></td>
<td rowspan="1" colspan="1">Returns the date of the last day of the month that contains <em>date.</em></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>last_value(expression) over (analytics)</em></td>
<td rowspan="1" colspan="1">Returns the last value in an ordered set of values; refer to the vendor documentation for more information.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>lead(expression [,offset][,default]) over(analytics)</em></td>
<td rowspan="1" colspan="1">Provides access to more than one row of a table at the same time without a self join. Analytic functions are beyond the scope of this text.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>least(expression [,...n])</em></td>
<td rowspan="1" colspan="1">Returns the least of the list of <em>expressions.</em></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>length(string)</em></td>
<td rowspan="1" colspan="1">Returns the integer length of <em>string</em>, or null if <em>string</em> is null.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>lengthb(string)</em></td>
<td rowspan="1" colspan="1">Returns the length of <em>char</em><em> </em>in bytes; otherwise, the same as <em>LENGTH.</em></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>ln(number)</em></td>
<td rowspan="1" colspan="1">Returns the natural logarithm of <em>number</em>, where the <em>number</em><em> </em>is greater than 0.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>log(base_number, number)</em></td>
<td rowspan="1" colspan="1">Returns the logarithm of any <em>base_number</em> of <em>number</em>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>lower(string)</em></td>
<td rowspan="1" colspan="1">Returns <em>string</em> in the same datatype as it was supplied with all characters lowercase.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>lpad(string1, number [,string2])</em></td>
<td rowspan="1" colspan="1">Returns <em>string1</em>, left-padded to length <em>number</em><em> </em>using characters in <em>string2</em>; <em>string2</em><em> </em>defaults to a single blank.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>ltrim(string[, set])</em></td>
<td rowspan="1" colspan="1">Removes all characters in <em>set</em> from the left of <em>string</em>. <em>Set</em><em> </em>defaults to a single blank.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>make_ref({table_name | view_name} , key [,...n])</em></td>
<td rowspan="1" colspan="1">Creates a reference (<em>REF </em>) to a row of an object view or a row in an object table whose object identifier is primary<br />
key-based.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>max([DISTINCT] expression) over (analytics)</em></td>
<td rowspan="1" colspan="1">Returns maximum value of <em>expression</em>. It can be used as an aggregate or analytic function (analytic functions are beyond the scope of this text).</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>min([DISTINCT] expression) over (analytics)</em></td>
<td rowspan="1" colspan="1">Returns minimum value of <em>expression</em>. It can be used as an aggregate or analytic function (analytic functions are beyond the scope of this text).</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>mod(dividend, divider)</em></td>
<td rowspan="1" colspan="1">Returns remainder of <em>dividend</em><em> </em>divided by <em>divider </em>; returns the <em>dividend</em><em> </em>if <em>divider</em><em> </em>is 0.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>months_between<br />
(date1, date2)</em></td>
<td rowspan="1" colspan="1">Returns number of months between dates <em>date1</em><em> </em>and <em>date2</em>. When <em>date1</em><em> </em>is later than <em>date2</em>, the result is positive. If it is earlier, the result is negative.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>new_time(date, time_zone1, time_zone2)</em></td>
<td rowspan="1" colspan="1">Returns the date and time in <em>time_zone2</em><em> </em>when date and time in <em>time_zone1</em><em> </em>are <em>date</em>. <em>Time_zones</em> 1 and 2 may be any of these text strings:</p>
<ul>
<ul>
<li>AST, ADT: Atlantic Standard or Daylight Time</li>
</ul>
</ul>
<ul>
<ul>
<li>BST, BDT: Bering Standard or Daylight Time</li>
</ul>
</ul>
<ul>
<ul>
<li>CST, CDT: Central Standard or Daylight Time</li>
</ul>
</ul>
<ul>
<ul>
<li>EST, EDT: Eastern Standard or Daylight Time</li>
</ul>
</ul>
<ul>
<ul>
<li>GMT: Greenwich Mean Time</li>
</ul>
</ul>
<ul>
<ul>
<li>HST, HDT: Alaska-Hawaii Standard Time or Daylight Time</li>
</ul>
</ul>
<ul>
<ul>
<li>MST, MDT: Mountain Standard or Daylight Time</li>
</ul>
</ul>
<ul>
<ul>
<li>NST: Newfoundland Standard Time</li>
</ul>
</ul>
<ul>
<ul>
<li>PST, PDT: Pacific Standard or Daylight Time</li>
</ul>
</ul>
<ul>
<ul>
<li>YST, YDT: Yukon Standard or Daylight Time</li>
</ul>
</ul>
<p>&nbsp;</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>next_day(date, string)</em></td>
<td rowspan="1" colspan="1">Returns the date of the first weekday named by <em>string</em><em> </em>that is later than <em>date</em>. The argument <em>string </em><em></em>must be either the full name or the abbreviation of a day of the week in the date language of the session.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>nls_charset_decl_len(bytecnt, csid)</em></td>
<td rowspan="1" colspan="1">Returns the declaration width (<em>bytecnt</em>) of an <em>NCHAR</em> column using the character set ID (<em>csid </em>) of the column.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>nls_charset_id(text)</em></td>
<td rowspan="1" colspan="1">Returns the NLS character set ID number corresponding to <em>text.</em></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>nls_charset_name(number)</em></td>
<td rowspan="1" colspan="1">Returns the <em>VARCHAR2 </em>name for the NLS character set corresponding to the ID <em>number.</em></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>nls_initcap(string [,'nlsparameter'])</em></td>
<td rowspan="1" colspan="1">Returns <em>string</em> with the first letter of each word in uppercase and all other letters in lowercase. The <em>nlsparameter</em>offers special linguistic sorting features.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>nls_lower(string, [,'nlsparameter'])</em></td>
<td rowspan="1" colspan="1">Returns <em>string</em> with all letters lowercase. The <em>nlsparameter</em> offers special linguistic sorting features.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>nlssort(string [,'nlsparameter'])</em></td>
<td rowspan="1" colspan="1">Returns the string of bytes used to sort <em>string</em>. The <em>nlsparameter</em> offers special linguistic sorting features.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>nls_upper string [,'nlsparameter'])</em></td>
<td rowspan="1" colspan="1">Returns <em>string</em> with all letters uppercase. The <em>nlsparameter</em> offers special linguistic sorting features.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>ntile(expression) over<br />
( query_partition ORDER BY&#8230;)</em></td>
<td rowspan="1" colspan="1">Divides an ordered data set into a number of buckets numbered 1 to <em>expression</em><em> </em>and assigns the appropriate bucket number to each row.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>numtodsinterval<br />
(number, `string&#8217;)</em></td>
<td rowspan="1" colspan="1">Converts <em>number</em><em> </em>to an <em>INTERVAL DAY TO SECOND</em> literal, where <em>number</em><em> </em>is a number or an expression resolving to a number, such as a numeric datatype column.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>numtoyminterval<br />
(number, `string&#8217;)</em></td>
<td rowspan="1" colspan="1">Converts <em>number</em><em> </em>to an <em>INTERVAL DAY TO MONTH</em> literal, where <em>number</em><em> </em>is a number or an expression resolving to a number, such as a numeric datatype column.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>nvl(expression1, expression2)</em></td>
<td rowspan="1" colspan="1">If <em>expression1</em><em> </em>is null, <em>expression2</em> is returned in the place of a null value. Otherwise, <em>expression1</em> is returned. The expressions may be any datatype.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>nvl2(expression1, expression2, expression3)</em></td>
<td rowspan="1" colspan="1">Similar to <em>NLV</em>, except that if <em>expression1</em> is not null, <em>expression2 </em>is returned. If <em>expression1</em> is null, <em>expression3</em>is returned. The expressions may be any datatype, except <em>LONG</em>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>percent_rank( ) over<br />
( query_partition ORDER BY&#8230;)</em></td>
<td rowspan="1" colspan="1">Similar to the <em>CUME_DIST </em>analytical function. Rather than return the cumulative distribution, it returns the percentage rank of a row compared to the others in its result set. Refer to the vendor documentation for more assistance.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>power(number, power)</em></td>
<td rowspan="1" colspan="1">Returns <em>number </em>raised to the nth <em>power</em>. The base and the exponent can be any numbers, but if <em>number</em><em> </em>is negative, <em>power</em><em> </em>must be an integer.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>rank (value_expression) over ( query_partition ORDER BY &#8230;)</em></td>
<td rowspan="1" colspan="1">Computes the rank of each row returned from a query with respect to the other rows returned by the query, based on the values of the <em>value_expression</em> in the <em>ORDER_BY_clause</em>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>ratio_to_report<br />
(value_exprs) over<br />
( query_partition)</em></td>
<td rowspan="1" colspan="1">Computes the ratio of a value to the sum of a set of values. If <em>values_expr</em><em> </em>is null, the ratio-to-report value also is null.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>rawtohex(raw)</em></td>
<td rowspan="1" colspan="1">Converts a <em>raw</em><em> </em>value to a string (character datatype) of its hexadecimal equivalent.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>ref(table_alias)</em></td>
<td rowspan="1" colspan="1"><em>REF</em> takes a table alias associated with a row from a table or view. A special reference value is returned for the object instance that is bound to the variable or row.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>reftohex(expression)</em></td>
<td rowspan="1" colspan="1">Converts argument <em>expression </em>to a character value containing its hexadecimal equivalent.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>regr_ xxx(expression1, expression2) over (analytics)</em></td>
<td rowspan="1" colspan="1">Linear regression functions fit an ordinary-least-squares regression line to a set of number pairs where <em>expression1</em>is the dependent variable and <em>expression2</em> is the independent variable. The linear regression functions are:</p>
<ul>
<ul>
<li>REGR_SLOPE: returns the slope of the line</li>
</ul>
</ul>
<ul>
<ul>
<li>REGR_INTERCEPT: returns the y-intercept of the regression line</li>
</ul>
</ul>
<ul>
<ul>
<li>REGR_COUNT: returns the number of non-null pairs fitting the regression line</li>
</ul>
</ul>
<ul>
<ul>
<li>REGR_R2: returns the coefficient of determination for the regression</li>
</ul>
</ul>
<ul>
<ul>
<li>REGR_AVGX: returns the average of the independent variable</li>
</ul>
</ul>
<ul>
<ul>
<li>REGR_AVGY: returns the average of the dependent variable</li>
</ul>
</ul>
<ul>
<ul>
<li>REGR_SXX: calculates <em>REGR_COUNT(exp1, exp2) *<br />
VAR_POP(exp2)</em></li>
</ul>
</ul>
<ul>
<ul>
<li>REGR_SYY: calculates <em>REGR_COUNT(exp1, exp2) *<br />
VAR_POP(exp1)</em></li>
</ul>
</ul>
<ul>
<ul>
<li>REGR_SXY: calculates <em>REGR_COUNT(exp1, exp2) * COVAR_POP(exp1, exp2)</em></li>
</ul>
</ul>
<p>These can be used as aggregate or analytic functions.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>replace(string, search_string [,replacement_string])</em></td>
<td rowspan="1" colspan="1">Returns <em>string</em><em> </em>with every occurrence of <em>search_string</em><em> </em>replaced with <em>replacement_string.</em></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>round (number, decimal)</em></td>
<td rowspan="1" colspan="1">Returns <em>number</em><em> </em>rounded to <em>decimal</em><em> </em>places right of the decimal point. When <em>decimal</em><em> </em>is omitted, <em>number</em><em> </em>is rounded to 0 places. Note that <em>decimal</em>, an integer, can be negative to round off digits left of the decimal point.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>round (date[, format])</em></td>
<td rowspan="1" colspan="1">Returns the <em>date</em><em> </em>rounded to the unit specified by the format model <em>format</em>. When <em>format</em> is omitted, <em>date</em><em> </em>is rounded to the nearest day.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>row_number ( ) over<br />
( query_partition ORDER BY &#8230; )</em></td>
<td rowspan="1" colspan="1">Assigns a unique number to each row where it is applied in the ordered sequence of rows specified by the<em>ORDER_BY_clause</em>, beginning with 1.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>rowidtochar(rowid)</em></td>
<td rowspan="1" colspan="1">Converts a <em>rowid</em> value to <em>VARCHAR2</em> datatype, 18 characters long.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>rpad(string1, number [, string2])</em></td>
<td rowspan="1" colspan="1">Returns <em>string1</em>, right-padded to length <em>number</em> with the value of <em>string2</em>, repeated as needed. <em>String2</em><em> </em>defaults to a single blank.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>rtrim(string[,set])</em></td>
<td rowspan="1" colspan="1">Returns <em>string</em>, with all the rightmost characters that appear in <em>set</em><em> </em>removed; <em>set</em><em> </em>defaults to a single blank.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>sign(number)</em></td>
<td rowspan="1" colspan="1">When <em>number</em> &lt; 0, returns -1. When <em>number</em> = 0, returns 0. When <em>number</em> &gt; 0, returns 1.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>sin(number)</em></td>
<td rowspan="1" colspan="1">Returns the sine of <em>number</em> as an angle expressed in radians.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>sinh(number)</em></td>
<td rowspan="1" colspan="1">Returns the hyperbolic sine of <em>number.</em></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>soundex(string)</em></td>
<td rowspan="1" colspan="1">Returns a character string containing the phonetic representation of <em>string</em>. This function allows words that are spelled differently but sound alike in English to be compared for equality.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>sqrt(number)</em></td>
<td rowspan="1" colspan="1">Returns square root of <em>number</em>, a nonnegative number.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>stddev( [DISTINCT] expression) over (analytics)</em></td>
<td rowspan="1" colspan="1">Returns sample standard deviation of a set of numbers shown as<em> expression.</em></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>stdev_pop(expression) over (analytics)</em></td>
<td rowspan="1" colspan="1">Computes the population standard deviation and returns the square root of the population variance.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>seddev_samp(expression) over (analytics)</em></td>
<td rowspan="1" colspan="1">Computes the cumulative sample standard deviation and returns the square root of the sample variance.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>substr(extraction_string [FROM starting_position] [FOR length])</em></td>
<td rowspan="1" colspan="1">Refer to the earlier section on <em>SUBSTR.</em></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>substrb(extraction_string [FROM starting_position] [FOR length])</em></td>
<td rowspan="1" colspan="1"><em>SUBSTRB</em> is the same as <em>SUBSTR</em>, except that the arguments <em>m</em><em> starting_position</em><em> </em>and <em>length</em><em> </em>are expressed in bytes, rather than in characters.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>sum([DISTINCT ] expression) over (analytics)</em></td>
<td rowspan="1" colspan="1">Returns sum of values of <em>expr </em>; refer to vendor documentation for assistance with analytics and the <em>OVER</em>subclause.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>sys_context<br />
(`namespace&#8217;,'attribute&#8217;<br />
[,length])</em></td>
<td rowspan="1" colspan="1">Returns the value of <em>attribute</em><em> </em>associated with the context <em>namespace</em>, usable in both SQL and PL/SQL statements.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>sys_guid( )</em></td>
<td rowspan="1" colspan="1">Generates and returns a globally unique identifier <code>(</code><em>RAW</em> value) made up of 16 bytes.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>sysdate</em></td>
<td rowspan="1" colspan="1">Returns the current date and time, requiring no arguments.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>tan(number)</em></td>
<td rowspan="1" colspan="1">Returns the tangent of <em>number </em>as an angle expressed in radians.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>tanh(number)</em></td>
<td rowspan="1" colspan="1">Returns the hyperbolic tangent of <em>number</em></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>to_char (date [, format<br />
[, `nls_parameter']])</em></td>
<td rowspan="1" colspan="1">Converts <em>date</em><em> </em>to a <em>VARCHAR2</em> in the format specified by the date format <em>format</em>. When <em>fmt</em> is omitted, <em>date</em><em> </em>is converted to the default date format. The <em>nls_parameter</em> option offers additional control over formatting options.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>to_char (number<br />
[, format [, `nls_parameter']])</em></td>
<td rowspan="1" colspan="1">Converts <em>number</em><em> </em>to a <em>VARCHAR2</em> in the format specified by the number format <em>format</em>. When <em>fmt</em> is omitted,<em>number</em><em> </em>is converted to a string long enough to hold the <em>number</em>. The <em>nls_parameter</em> option offers additional control over formatting options.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>to_date(string [, format<br />
[, `nls_parameter']])</em></td>
<td rowspan="1" colspan="1">Converts <em>string</em><em> </em>(in <em>CHAR</em> or <em>VARCHAR2) </em>to a <em>DATE</em> datatype. The <em>nls_parameter</em> option offers additional control over formatting options.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>to_lob(long_column)</em></td>
<td rowspan="1" colspan="1">Usable only by <em>LONG</em> or <em>LONG RAW</em> expressions, it converts <em>LONG</em> or <em>LONG RAW</em> values in the column<em>long_column</em><em> </em>to LOB values. It is usable only in the <em>SELECT</em> list of a subquery in an <em>INSERT</em> statement.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>to_multi_byte(string)</em></td>
<td rowspan="1" colspan="1">Returns <em>string </em>with all of its single-byte characters converted to their corresponding multi-byte characters.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>to_number(string [, format [,'nls_parameter']])</em></td>
<td rowspan="1" colspan="1">Converts a numeric <em>string</em> (of <em>CHAR</em> or <em>VARCHAR2</em> datatype) to a value of a NUMBER datatype in the format specified by the optional format model <em>format</em>. The <em>nls_parameter</em> option offers additional control over formatting options.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>to_single_byte(string)</em></td>
<td rowspan="1" colspan="1">Returns <em>string</em><em> </em>with all of its multi-byte characters converted to their corresponding single-byte characters.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>translate(`char_value&#8217;, `from_text&#8217;, `to_text&#8217;)</em></td>
<td rowspan="1" colspan="1">Returns <em>char_value</em><em> </em>with all occurrences of each character in <em>from_text</em><em> </em>replaced by its corresponding character in<em>to_text</em>; refer to the section &#8220;<a href="http://oreilly.com/catalog/sqlnut/chapter/ch04.html#_Toc484170304">CONVERT and TRANSLATE</a>&#8221; earlier in this chapter for more information on<em>TRANSLATE.</em></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>translate (text USING [CHAR_CS | NCHAR_CS] )</em></td>
<td rowspan="1" colspan="1">Converts <em>text</em><em> </em>into the character set specified for conversions between the database character set or the national character set.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>trim({[LEADING | TRAILING | BOTH] trim_char | trim_char }</em><em>FROM trim_source} )</em></td>
<td rowspan="1" colspan="1">Enables leading or trailing characters (or both) to be trimmed from a character string.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>trunc (base [, number])</em></td>
<td rowspan="1" colspan="1">Returns <em>base</em><em> </em>truncated to <em>number</em><em> </em>decimal places. When <em>number</em><em> </em>is omitted, <em>base</em><em> </em>is truncated to 0 places.<em>Number</em><em> </em>can be negative to truncate (make zero) <em>number</em><em> </em>digits left of the decimal point.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>trunc (date [, format])</em></td>
<td rowspan="1" colspan="1">Returns <em>date </em>with any time data truncated to the unit specified by <em>format</em>. When <em>format</em> is omitted, <em>date</em><em> </em>is truncated to the nearest whole day.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>uid</em></td>
<td rowspan="1" colspan="1">Returns an integer that uniquely identifies the session user who logged on. No parameters are needed.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>upper(string)</em></td>
<td rowspan="1" colspan="1">Returns <em>string</em> with all letters in uppercase.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>user</em></td>
<td rowspan="1" colspan="1">Returns the name of the session user who logged on in <em>VARCHAR2.</em></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>userenv(option)</em></td>
<td rowspan="1" colspan="1">Returns information about the current session in <em>VARCHAR2.</em></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>value(table_alias)</em></td>
<td rowspan="1" colspan="1">Takes as a table alias associated with a row in an object table and returns object instances stored within the object table.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>var_pop(expression)<br />
over (analytics)</em></td>
<td rowspan="1" colspan="1">Returns the population variance of a set of numbers after discarding the nulls in the <em>expression </em>number<em> </em>set. Analytic functions are covered in the vendor documentation.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>var_samp(expression) over (analytics)</em></td>
<td rowspan="1" colspan="1">Returns the sample variance of a set of numbers after discarding the nulls in the <em>expression </em>number<em> </em>set. Analytic functions are covered in the vendor documentation.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>variance([DISTINCT] expression) over (analytics)</em></td>
<td rowspan="1" colspan="1">Returns variance of <em>expression</em> calculated as follows:</p>
<ul>
<ul>
<li>0 if the number of rows in <em>expression</em> = 1</li>
</ul>
</ul>
<ul>
<ul>
<li><em>VAR_SAMP</em> if the number of rows in <em>expression</em> &gt; 1</li>
</ul>
</ul>
<p>&nbsp;</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><em>vsize(expression)</em></td>
<td rowspan="1" colspan="1">Returns the number of bytes in the internal representation of <em>expression</em>. When <em>expression</em> is null, it returns null.</td>
</tr>
</tbody>
</table>
<pre></pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kirandn.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kirandn.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kirandn.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kirandn.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kirandn.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kirandn.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kirandn.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kirandn.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kirandn.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kirandn.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kirandn.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kirandn.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kirandn.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kirandn.wordpress.com/69/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kirandn.wordpress.com&amp;blog=23979747&amp;post=69&amp;subd=kirandn&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kirandn.wordpress.com/2011/11/12/sql-functions/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/94a8b63b04511b605370006669f83b28?s=96&#38;d=retro&#38;r=X" medium="image">
			<media:title type="html">kirandn</media:title>
		</media:content>

		<media:content url="http://oreilly.com/catalog/sqlnut/chapter/pi.gif" medium="image" />

		<media:content url="http://oreilly.com/catalog/sqlnut/chapter/pi.gif" medium="image" />

		<media:content url="http://oreilly.com/catalog/sqlnut/chapter/pi.gif" medium="image" />

		<media:content url="http://oreilly.com/catalog/sqlnut/chapter/pi.gif" medium="image" />

		<media:content url="http://oreilly.com/catalog/sqlnut/chapter/pi.gif" medium="image" />

		<media:content url="http://oreilly.com/catalog/sqlnut/chapter/pi.gif" medium="image" />

		<media:content url="http://oreilly.com/catalog/sqlnut/chapter/pi.gif" medium="image" />
	</item>
		<item>
		<title>30 Tips While developing any web site, one should keep some points in mind.</title>
		<link>http://kirandn.wordpress.com/2011/11/09/30-tips-while-developing-any-web-site-one-should-keep-some-points-in-mind/</link>
		<comments>http://kirandn.wordpress.com/2011/11/09/30-tips-while-developing-any-web-site-one-should-keep-some-points-in-mind/#comments</comments>
		<pubDate>Wed, 09 Nov 2011 07:40:40 +0000</pubDate>
		<dc:creator>kirandn</dc:creator>
				<category><![CDATA[Asp.Net]]></category>

		<guid isPermaLink="false">http://kirandn.wordpress.com/?p=63</guid>
		<description><![CDATA[1) Set debug=false under compilation as follows: 2) Use Server.Transfer instead of Response.Redirect. 3) Always check Page.IsValid when using Validator &#8230;<p><a href="http://kirandn.wordpress.com/2011/11/09/30-tips-while-developing-any-web-site-one-should-keep-some-points-in-mind/">Continue reading &#187;</a></p><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kirandn.wordpress.com&amp;blog=23979747&amp;post=63&amp;subd=kirandn&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1) Set debug=false under compilation as follows:</p>
<p>2) Use Server.Transfer instead of Response.Redirect.</p>
<p>3) Always check Page.IsValid when using Validator Controls</p>
<p>4) Use Foreach loop instead of For loop for String Iteration.</p>
<p>5) Use Client-Side Validation. (but not all the time you have to validate even on the server side)</p>
<p>6) Check “Page.IsPostBack”. To avoid repetition code execution.</p>
<p>7) GIF and PNG are similar, but PNG typically produces a lower file size. (True, but some browsers not supporting PNG format)</p>
<p>8) Use the AppOffline.htm when updating binaries</p>
<p>9) Turn off Tracing unless until required. (by default it&#8217;s off, use on the pages where it&#8217;s required)</p>
<p>10) Precompiled pages and disable AutoEventWireup; setting the AutoEventWireup attribute to false in the Machine.config file.<br />
11) Turn off Session State, if not required.</p>
<p>12) Select the Release mode before making the final Build for your application.</p>
<p>This option is available in the Top Frame just under the Window Menu option. By default, the Mode is Debug</p>
<p>13) Disable ViewState when not required.</p>
<p>EnableViewState=&#8221;false&#8221;</p>
<p>14) Avoid frequent round trips to the Database.</p>
<p>15) Use Caching to improve the performance of your application.</p>
<p>16) Validate all Input received from the Users.</p>
<p>17) Use Finally Method to kill resources. (But not in the case of using)</p>
<p>18) The String and Stringbuilder Magic.</p>
<p>It is nice to use Stringbuilder instead of String when string are Amended. Strings occupy different memory location in every time of amended where stringbuilder use single memory location</p>
<p>19) Never use object value directly; first get object value in local variable and then use. It takes more time then variable reading.</p>
<p>20) Avoid Exceptions: Use If condition (if it is check proper condition)</p>
<p>21) Code optimization:  Avoid using code like x = x +1; it is always better to use x+=1.</p>
<p>22) Data Access Techniques: DataReaders provide a fast and efficient method of data retrieval. DataReader is much faster than DataSets as far as performance is concerned</p>
<p>23) Before doing a bulky ASP code processing, you can check to make sure Response.IsClientConnected.</p>
<p>24) As always, avoid session variables because each ASP page runs in a different thread and session calls will be serialized one by one. So, this will slow down the application. Instead of session variables you can use the QueryString collection or hidden variables in the form which holds the values.</p>
<p>25) Enabling buffering will improve the performance, like</p>
<p>Then use:</p>
<p>26) Use Repeater control instead of DataGrid , DataList, Because It is efficient, customizable, and programmable.</p>
<p>27) Data listing is more time consume when large data are retrieve from database.</p>
<p>Paging will display only particular data but take load of all data.</p>
<p>Fetch only data that is needed for current page.</p>
<p>28) Avoid Inline JavaScript and CSS</p>
<p>29) Use single css file instead of multiple css file.</p>
<p>Try your best to combine all your CSS based classes into a single .css file as lot of .css files will cause a large amount of requests, regardless of the file sizes.</p>
<p>.css files are normally cached by browsers, so a single and heavy .css file doesn’t cause a long wait on each page request.</p>
<p>Inline .css classes could make HTML heavy, so again: go ahead with a single.css file.</p>
<p>30) Reduce cookie size</p>
<p>31) Compress CSS, JavaScript and Images</p>
<p>Online compressors are available; to compress file please refers following web and Replace your file content with optimize code.</p>
<p>http://iceyboard.no-ip.org/projects/css_compressor for CSS compression</p>
<p>www.xtreeme.com/javascript-optimizer/ . For JS Compression</p>
<p>32 .Use Cache appropriately</p>
<p>i. Page output caching:</p>
<p>ii. Page fragment caching:</p>
<p>Write a Page output caching code into each User Control</p>
<p>iii. Data caching:</p>
<p>Protected void Page_Load (Object src, EventArgs e) {</p>
<p>DataView dv = (DataView) Cache. Get (&#8220;EmployeesDataView&#8221;);</p>
<p>If (dv == null) { // wasn&#8217;t thereSqlConnection conn =</p>
<p>new SqlConnection (&#8220;server=localhost;uid=sa;pwd=;database=Test&#8221;);</p>
<p>SqlDataAdapter da =new SqlDataAdapter (&#8220;select * from Employees&#8221;, conn);</p>
<p>Dataset ds = new DataSet();da.Fill(ds, &#8220;Employees&#8221;);</p>
<p>dv = ds.Tables["Employees"].DefaultView;</p>
<p>Cache.Insert (&#8220;EmployeesDataView&#8221;, dv);conn.Close();}</p>
<p>Else</p>
<p>Response.Write (&#8220;<br />
<h2>Loaded employees from data cache! </h2>
<p>&#8220;);</p>
<p>lb1.DataSource = dv;</p>
<p>lb1.DataTextField = &#8220;Name&#8221;;</p>
<p>lb1.DataValueField = &#8220;Age&#8221;;</p>
<p>DataBind () ;}</p>
<p>33) Use server side compression software such as Port80s http://www.port80software.com/products/httpzip/  </p>
<p>34) Usage of &#8220;using&#8221; and I don&#8217;t know why it&#8217;s not yet published.</p>
<p>35) Don&#8217;t make the member variables public or proteted, try to keep private and use public/protected as properties.</p>
<p>36) Use strString=string.Empty instead of strString=&#8221;" . [And perhaps instead of strString=null also (?)]</p>
<p>37) Make your page files as light as possible. That is try to avoid unnecessary markups, e.g. use div elements instead of tables.</p>
<p>38) Write static messages in div and make it visible when necessary. This is faster than letting server set Text property of your label or div.</p>
<p>39) Retrieve data from database at once, if possible. Don&#8217;t add up to database trip as far as possible. For this, combine the datafields from different tables and select them.</p>
<p>40) Use short ID name for WebControl. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kirandn.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kirandn.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kirandn.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kirandn.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kirandn.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kirandn.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kirandn.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kirandn.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kirandn.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kirandn.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kirandn.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kirandn.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kirandn.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kirandn.wordpress.com/63/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kirandn.wordpress.com&amp;blog=23979747&amp;post=63&amp;subd=kirandn&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kirandn.wordpress.com/2011/11/09/30-tips-while-developing-any-web-site-one-should-keep-some-points-in-mind/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/94a8b63b04511b605370006669f83b28?s=96&#38;d=retro&#38;r=X" medium="image">
			<media:title type="html">kirandn</media:title>
		</media:content>
	</item>
		<item>
		<title>TOP 10 ASP.NET MVC Framework Websites</title>
		<link>http://kirandn.wordpress.com/2011/11/08/top-10-asp-net-mvc-framework-websites/</link>
		<comments>http://kirandn.wordpress.com/2011/11/08/top-10-asp-net-mvc-framework-websites/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 12:20:55 +0000</pubDate>
		<dc:creator>kirandn</dc:creator>
				<category><![CDATA[Asp.Net]]></category>

		<guid isPermaLink="false">http://kirandn.wordpress.com/?p=42</guid>
		<description><![CDATA[What’s ASP.NET MVC Framework? Hi, there! If you’ve never heard about what’s ASP.NET MVC Framework, here I’d like to introduce something about &#8230;<p><a href="http://kirandn.wordpress.com/2011/11/08/top-10-asp-net-mvc-framework-websites/">Continue reading &#187;</a></p><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kirandn.wordpress.com&amp;blog=23979747&amp;post=42&amp;subd=kirandn&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter" src="http://www.findmyhosts.com/images/ASP_NET_MVC.png" alt="ASP.NET MVC Framework" /></p>
<h3>What’s ASP.NET MVC Framework?</h3>
<p>Hi, there! If you’ve never heard about what’s <strong>ASP.NET MVC</strong> Framework, here I’d like to introduce something about the new Microsoft ASP.NET revolutional product. <strong>ASP.NET MVC</strong> is a free, fully supported, Microsoft product that enables developers to easily build great web applications. It provides total control over your HTML and URLs, enables rich AJAX integration, and facilitates test driven development.</p>
<p>And here I’d like to collect the top 10 websites which’re using <strong>ASP.NET MVC</strong> framework application.</p>
<h3>TOP 10 ASP.NET MVC Framework Websites</h3>
<table width="100%" border="1">
<tbody>
<tr>
<td width="20"><strong>1</strong></td>
<td valign="top"><a href="http://www.codeplex.com/" target="_blank"><strong>Code Plex</strong></a>CodePlex can be the first website which is using ASP.NET MVC Framework. Codeplex is microsoft’s open source project hosting web site. You can use CodePlex to find open source software or create new projects to share with the world.</p>
<p>http://www.codeplex.com</td>
</tr>
</tbody>
</table>
<table width="100%" border="0">
<tbody>
<tr>
<td width="20"><strong>2</strong></td>
<td valign="top"><a href="http://www.stackoverflow.com/" target="_blank"><strong>Stack Over Flow</strong></a>Stackoverflow.com is another famous website based on ASP.NET MVC technique. Stackoverflow.com is a language-independent collaboratively edited question and answer site for programmers.</p>
<p>http://www.stackoverflow.com</td>
</tr>
</tbody>
</table>
<table width="100%" border="1">
<tbody>
<tr>
<td width="20"><strong>3</strong></td>
<td valign="top"><a href="http://www.bing.com/shopping/" target="_blank"><strong>Bing Shopping</strong></a>Consumers go online to compare products, to share opinions with other consumers and to compare prices. Bing Shopping simplifies search by combining these things to help consumers save money and make purchase decisions more quickly.</p>
<p>http://www.bing.com/shopping/</td>
</tr>
</tbody>
</table>
<table width="100%" border="1">
<tbody>
<tr>
<td width="20"><strong>4</strong></td>
<td valign="top"><a href="http://www.kbb.com/" target="_blank"><strong>Kelley Blue Book</strong></a>Kelley Blue Book is the trusted resource for prices, values and reviews on new cars and used cars. Before buying or selling your next car, visit KBB.com.</p>
<p>http://www.Kbb.com</td>
</tr>
</tbody>
</table>
<table width="100%" border="1">
<tbody>
<tr>
<td width="20"><strong>5</strong></td>
<td valign="top"><a href="http://www.marketwatch.com/" target="_blank"><strong>Market Watch</strong></a>MarketWatch operates a financial information website that provides business news, analysis and stock market data to some 6 million people.</p>
<p>http://www.marketwatch.com/</td>
</tr>
</tbody>
</table>
<table width="100%" border="1">
<tbody>
<tr>
<td width="20"><strong>6</strong></td>
<td valign="top"><a href="http://www.ruthschris.com/" target="_blank"><strong>Ruths Chris</strong></a>Ruth’s Chris Steak House: Best Prime Steak Restaurant! Steakhouse restaurant serving the best prime steak sizzling hot.</p>
<p>http://www.ruthschris.com/</td>
</tr>
</tbody>
</table>
<table width="100%" border="1">
<tbody>
<tr>
<td width="20"><strong>7</strong></td>
<td valign="top"><a href="http://www.dotnetshoutout.com/" target="_blank"><strong>DotNet Shout Out</strong></a>DotNetShoutout.com is a place where you can find latest Microsoft .NET stories to increase your skills and share your opinions. You can find DotNetShoutout is using Kigg ASP.NET MVC framework project.</p>
<p>http://www.Dotnetshoutout.com</td>
</tr>
</tbody>
</table>
<table width="100%" border="1">
<tbody>
<tr>
<td width="20"><strong>8</strong></td>
<td valign="top"><a href="http://www.servefault.com/" target="_blank"><strong>Servefault</strong></a>Servefault.com is the most popular PHP, CGI, Perl, JavaScript and ASP.Net script collection and resources portal website.</p>
<p>http://www.leandrovieira.com</td>
</tr>
</tbody>
</table>
<table width="100%" border="1">
<tbody>
<tr>
<td width="20"><strong>9</strong></td>
<td valign="top"><a href="http://www.serverfault.com/" target="_blank"><strong>Server Fault</strong></a>Server Fault is a collaboratively edited question and answer site for system administrators and IT professionals – regardless of platform.</p>
<p>http://www.Serverfault.com</td>
</tr>
</tbody>
</table>
<table width="100%" border="1">
<tbody>
<tr>
<td width="20"><strong>10</strong></td>
<td valign="top"><a href="http://dotnetkicks.com/" target="_blank"><strong>DotNetKicks</strong></a>DotNetKicks.com is a community based news site edited by our members. It specialises in .NET development techniques, technologies and tools including ASP.</p>
<p>http://www.DotNetKicks.com</td>
</tr>
</tbody>
</table>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kirandn.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kirandn.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kirandn.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kirandn.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kirandn.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kirandn.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kirandn.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kirandn.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kirandn.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kirandn.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kirandn.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kirandn.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kirandn.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kirandn.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kirandn.wordpress.com&amp;blog=23979747&amp;post=42&amp;subd=kirandn&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kirandn.wordpress.com/2011/11/08/top-10-asp-net-mvc-framework-websites/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/94a8b63b04511b605370006669f83b28?s=96&#38;d=retro&#38;r=X" medium="image">
			<media:title type="html">kirandn</media:title>
		</media:content>

		<media:content url="http://www.findmyhosts.com/images/ASP_NET_MVC.png" medium="image">
			<media:title type="html">ASP.NET MVC Framework</media:title>
		</media:content>
	</item>
		<item>
		<title>20 Tips to Improve ASP.net Application Performance</title>
		<link>http://kirandn.wordpress.com/2011/11/07/20-tips-to-improve-asp-net-application-performance/</link>
		<comments>http://kirandn.wordpress.com/2011/11/07/20-tips-to-improve-asp-net-application-performance/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 10:47:39 +0000</pubDate>
		<dc:creator>kirandn</dc:creator>
				<category><![CDATA[Asp.Net]]></category>

		<guid isPermaLink="false">http://kirandn.wordpress.com/?p=37</guid>
		<description><![CDATA[Disable Session State Disable Session State if you’re not going to use it.  By default it’s on. You can actually &#8230;<p><a href="http://kirandn.wordpress.com/2011/11/07/20-tips-to-improve-asp-net-application-performance/">Continue reading &#187;</a></p><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kirandn.wordpress.com&amp;blog=23979747&amp;post=37&amp;subd=kirandn&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<ul>
<li><strong>Disable Session State</strong><br />
Disable Session State if you’re not going to use it.  By default it’s on. You can actually turn this off for specific pages, instead of for every page:</p>
<pre>&lt;%@ Page language="c#" Codebehind="WebForm1.aspx.cs"
AutoEventWireup="false" Inherits="WebApplication1.WebForm1"
EnableSessionState="false" %&gt;</pre>
<p>You can also disable it across the application in the web.config by setting the &lt;sessionState&gt; mode value to Off.</li>
<li><strong>Output Buffering<br />
</strong>Take advantage of this great feature.  Basically batch all of your work on the server, and then run a Response.Flush method to output the data.  This avoids chatty back and forth with the server.</p>
<pre>&lt;%response.buffer=true%&gt;</pre>
<p>Then use:</p>
<pre>&lt;%response.flush=<span style="color:#000000;">true%&gt; </span></pre>
</li>
<li><strong>Avoid Server-Side Validation</strong><br />
Try to avoid server-side validation, use client-side instead. Server-Side will just consume valuable resources on your servers, and cause more chat back and forth.</li>
<li><strong>Repeater Control Good,  DataList, DataGrid, and DataView controls Bad<br />
</strong>Asp.net is a great platform, unfortunately a lot of the controls that were developed are heavy in html, and create not the greatest scaleable html from a performance standpoint.  ASP.net  repeater control is awesome!  Use it!  You might write more code, but you will thank me in the long run!</li>
<li>Take advantage of <strong>HttpResponse.IsClientConnected</strong> before performing a large operation:
<pre>if (Response.IsClientConnected)
{
// If still connected, redirect
// to another page.
Response.Redirect("Page2CS.aspx", false);
}</pre>
<p>What is wrong with Response.Redirect? Read on…</li>
<li><strong>Use HTTPServerUtility.Transfer instead of Response.Redirect<br />
</strong>Redirect’s are also very chatty.  They should only be used when you are transferring people to another physical web server.  For any transfers within your server, use .transfer!  You will save a lot of needless HTTP requests.</li>
<li><strong>Always check Page.IsValid when using Validator Controls<br />
</strong>So you’ve dropped on some validator controls, and you think your good to go because ASP.net does everything for you!  Right? Wrong!  All that happens if bad data is received is the IsValid flag is set to false. So make sure you check Page.IsValid before processing your forms!</li>
<li><strong>Deploy with Release Build<br />
</strong>Make sure you use Release Build mode and not Debug Build when you deploy your site to production. If you think this doesn’t matter, think again.  By running in debug mode, you are creating PDB’s and cranking up the timeout.  Deploy Release mode and you will see the speed improvements.</li>
<li><strong>Turn off Tracing</strong><br />
Tracing is awesome, however have you remembered to turn it off? If not, make sure you edit your web.config and turn it off!  It will add a lot of overhead to your application that is not needed in a production environment.</p>
<pre>&lt;configuration&gt;
&lt;system.web&gt;
&lt;trace enabled="false" pageOutput="false" /&gt;
&lt;trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true"/&gt;
&lt;compilation debug="false" /&gt;
&lt;/system.web&gt;
&lt;/configuration&gt;</pre>
</li>
<li><strong>Page.IsPostBack is your friend<br />
</strong>Make sure you don’t execute code needlessly. I don’t know how many web developers forget about checking IsPostBack!  It seems like such a basic thing to me!  Needless processing!</li>
<li><strong>Avoid Exceptions<br />
</strong>Avoid throwing exceptions, and handling useless exceptions. Exceptions are probably one of the heaviest resource hogs and causes of slowdowns you will ever see in web applications, as well as windows applications.  Write your code so they don’t happen!  Don’t code by exception!</li>
<li><strong>Caching is Possibly the number one tip!<br />
</strong>Use Quick Page Caching and the ASP.net Cache API!  Lots to learn, its not as simple as you might think.  There is a lot of strategy involved here.  When do you cache?  what do you cache?</li>
<li><strong>Create Per-Request Cache<br />
</strong>Use HTTPContect.Items to add single page load to create a per-request cache.</li>
<li><strong>StringBuilder</strong><br />
StringBuilder.Append is faster than String + String.  However in order to use StringBuilder, you must</p>
<pre>new StringBuilder()</pre>
<p>Therefore it is not something you want to use if you don’t have large strings.  If you are concatenating less than 3 times, then stick with String + String. You can also try String.Concat</li>
<li><strong>Turn Off ViewState</strong><br />
If you are not using form postback, turn off viewsate, by default, controls will turn on viewsate and slow your site.</p>
<pre>public ShowOrdersTablePage()
{
this.Init += new EventHandler(Page_Init);
}

private void Page_Init(object sender, System.EventArgs e)
{
this.EnableViewState = false;
}</pre>
</li>
<li><strong>Use Paging<br />
</strong>Take advantage of paging’s simplicity in .net. Only show small subsets of data at a time, allowing the page to load faster.  Just be careful when you mix in caching.  How many times do you hit the page 2, or page 3 button?  Hardly ever right!  So don’t cache all the data in the grid! Think of it this way: How big would the first search result page be for “music” on Google if they cached all the pages from 1 to goggle <img src="http://www.realsoftwaredevelopment.com/wp-includes/images/smilies/icon_wink.gif" alt=";)" /></li>
<li><strong>Use the AppOffline.htm when updating binaries<br />
</strong>I hate the generic asp.net error messages!  If I never had to see them again I would be so happy.  Make sure your users never see them!  Use the AppOffline.htm file!</li>
<li><strong>Use ControlState and not ViewState for Controls</strong><br />
If you followed the last tip, you are probably freaking out at the though of your controls not working.  Simply use Control State.  Microsoft has an excellent example of using ControlState here, as I will not be able to get into all the detail in this short article.</li>
<li><strong>Use the Finally Method<br />
</strong>If you have opened any connections to the database, or files, etc, make sure that you close them at the end!  The Finally block is really the best place to do so, as it is the only block of code that will surely execute.</li>
<li><strong>Option Strict and Option Explicit<br />
</strong>This is an oldy, and not so much a strictly ASP.net tip, but a .net tip in general.  Make sure you turn BOTH on.  you should never trust .net or any compiler to perform conversions for you.  That’s just shady programming, and low quality code anyway.  If you have never turned both on, go turn them on right now and try and compile.  Fix all your errors.</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kirandn.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kirandn.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kirandn.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kirandn.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kirandn.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kirandn.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kirandn.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kirandn.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kirandn.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kirandn.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kirandn.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kirandn.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kirandn.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kirandn.wordpress.com/37/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kirandn.wordpress.com&amp;blog=23979747&amp;post=37&amp;subd=kirandn&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kirandn.wordpress.com/2011/11/07/20-tips-to-improve-asp-net-application-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/94a8b63b04511b605370006669f83b28?s=96&#38;d=retro&#38;r=X" medium="image">
			<media:title type="html">kirandn</media:title>
		</media:content>

		<media:content url="http://www.realsoftwaredevelopment.com/wp-includes/images/smilies/icon_wink.gif" medium="image">
			<media:title type="html">;)</media:title>
		</media:content>
	</item>
	</channel>
</rss>
