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

<channel>
	<title>JSP, Tomcat, JDBC, Projects, Example, Program &#187; MySQL</title>
	<atom:link href="http://www.easywayserver.com/blog/category/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.easywayserver.com/blog</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Mon, 31 May 2010 04:18:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SQL &#8211; ifnull() Example, ifnull() function</title>
		<link>http://www.easywayserver.com/blog/sql-ifnull-example-ifnull-function/</link>
		<comments>http://www.easywayserver.com/blog/sql-ifnull-example-ifnull-function/#comments</comments>
		<pubDate>Sat, 28 Nov 2009 09:27:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Select]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/sql-ifnull-example-ifnull-function/</guid>
		<description><![CDATA[SQL ifnull() function is used find null value in rows and returns value on our condition if null value found in column from database table name, otherwise if column value is not null it will return column value.
SQL ifnull() query example explains how to use ifnull() query in SQL.
Table class_name with all records without desired [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fsql-ifnull-example-ifnull-function%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fsql-ifnull-example-ifnull-function%2F" height="61" width="51" /></a></div><p>SQL ifnull() function is used find null value in rows and returns value on our condition if null value found in column from database table name, otherwise if column value is not null it will return column value.</p>
<p>SQL ifnull() query example explains how to use ifnull() query in SQL.</p>
<p>Table class_name with all records without desired column name sorting</p>
<div class="cde">
<p class="op">
<pre>
+---------+-------------+------------+------------+
| Roll_No | Name        | Class_Name | Year_Start |
+---------+-------------+------------+------------+
|       1 | Amit Mishra | B.Science  |       2005 |
|       2 | Robot       | B.Tech     |       2005 |
|       3 | Rohan       | M.Tech     |       2005 |
|       4 | Vivek       | B.Tech     |       2009 |
|       5 | Chander     | B.Science  |       2009 |
|       6 | Deepak      | B.Science  |       2009 |
|       7 | Gagan Deep  | B.Tech     |       NULL |
|       8 | Mohit Garg  | M.Tech     |       NULL |
+---------+-------------+------------+------------+
</pre>
</p>
</div>
<p><strong>ifnull() examples</strong></p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>SELECT</span>  Name<span style='color:#800080; '>,</span> Year_Start<span style='color:#800080; '>,</span> <span style='color:#400000; '>IFNULL</span><span style='color:#808030; '>(</span>Year_Start<span style='color:#800080; '>,</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>)</span> <span style='color:#800000; font-weight:bold; '>FROM</span> class_name c<span style='color:#800080; '>;</span>
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
<pre>
+-------------+------------+----------------------+
| Name        | Year_Start | IFNULL(Year_Start,0) |
+-------------+------------+----------------------+
| Amit Mishra |       2005 |                 2005 |
| Robot       |       2005 |                 2005 |
| Rohan       |       2005 |                 2005 |
| Vivek       |       2009 |                 2009 |
| Chander     |       2009 |                 2009 |
| Deepak      |       2009 |                 2009 |
| <strong>Gagan Deep  |       NULL |                    0</strong> |
| <strong>Mohit Garg  |       NULL |                    0</strong> |
+-------------+------------+----------------------+
</pre>
</p>
</div>
<p></p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>SELECT</span>  Name<span style='color:#800080; '>,</span> Year_Start<span style='color:#800080; '>,</span> <span style='color:#400000; '>IFNULL</span><span style='color:#808030; '>(</span>Year_Start<span style='color:#800080; '>,</span><span style='color:#008c00; '>2000</span><span style='color:#808030; '>)</span> <span style='color:#800000; font-weight:bold; '>FROM</span> class_name c<span style='color:#800080; '>;</span>
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
<pre>
+-------------+------------+-------------------------+
| Name        | Year_Start | IFNULL(Year_Start,2000) |
+-------------+------------+-------------------------+
| Amit Mishra |       2005 |                    2005 |
| Robot       |       2005 |                    2005 |
| Rohan       |       2005 |                    2005 |
| Vivek       |       2009 |                    2009 |
| Chander     |       2009 |                    2009 |
| Deepak      |       2009 |                    2009 |
| <strong>Gagan Deep  |       NULL |                    2000</strong> |
| <strong>Mohit Garg  |       NULL |                    2000</strong> |
+-------------+------------+-------------------------+
</pre>
</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/sql-ifnull-example-ifnull-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL &#8211; isnull() Example, isnull() function</title>
		<link>http://www.easywayserver.com/blog/sql-isnull-example-isnull-function/</link>
		<comments>http://www.easywayserver.com/blog/sql-isnull-example-isnull-function/#comments</comments>
		<pubDate>Sat, 28 Nov 2009 09:08:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Select]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/sql-select-isnull-example-isnull-function/</guid>
		<description><![CDATA[SQL isnull() function is used find null value in rows and returns 0 (zero) on if null value found in column from database table name, otherwise if column value is not null it will return 1 value. null value will replace automatically with zero value.
SQL isnull() query example explains how to use isnull() query in [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fsql-isnull-example-isnull-function%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fsql-isnull-example-isnull-function%2F" height="61" width="51" /></a></div><p>SQL isnull() function is used find null value in rows and returns 0 (zero) on if null value found in column from database table name, otherwise if column value is not null it will return 1 value. null value will replace automatically with zero value.</p>
<p>SQL isnull() query example explains how to use isnull() query in SQL.</p>
<p>Table class_name with all records without desired column name sorting</p>
<div class="cde">
<p class="op">
<pre>
+---------+-------------+------------+------------+
| Roll_No | Name        | Class_Name | Year_Start |
+---------+-------------+------------+------------+
|       1 | Amit Mishra | B.Science  |       2005 |
|       2 | Robot       | B.Tech     |       2005 |
|       3 | Rohan       | M.Tech     |       2005 |
|       4 | Vivek       | B.Tech     |       2009 |
|       5 | Chander     | B.Science  |       2009 |
|       6 | Deepak      | B.Science  |       2009 |
|       7 | Gagan Deep  | B.Tech     |       NULL |
|       8 | Mohit Garg  | M.Tech     |       NULL |
+---------+-------------+------------+------------+
</pre>
</p>
</div>
<p><strong>isnull() examples</strong></p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>SELECT</span>  Name<span style='color:#800080; '>,</span> Year_Start<span style='color:#800080; '>,</span> <span style='color:#400000; '>ISNULL</span><span style='color:#808030; '>(</span>Year_Start<span style='color:#808030; '>)</span> <span style='color:#800000; font-weight:bold; '>FROM</span> class_name c<span style='color:#800080; '>;</span>
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
<pre>
+-------------+------------+--------------------+
| Name        | Year_Start | ISNULL(Year_Start) |
+-------------+------------+--------------------+
| Amit Mishra |       2005 |                  0 |
| Robot       |       2005 |                  0 |
| Rohan       |       2005 |                  0 |
| Vivek       |       2009 |                  0 |
| Chander     |       2009 |                  0 |
| Deepak      |       2009 |                  0 |
| Gagan Deep  |       NULL |                  1 |
| Mohit Garg  |       NULL |                  1 |
+-------------+------------+--------------------+
</pre>
</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/sql-isnull-example-isnull-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL &#8211; Select distinct Example, distinct statement</title>
		<link>http://www.easywayserver.com/blog/sql-select-distinct-example-distinct-clause/</link>
		<comments>http://www.easywayserver.com/blog/sql-select-distinct-example-distinct-clause/#comments</comments>
		<pubDate>Sat, 28 Nov 2009 08:23:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Select]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/?p=445</guid>
		<description><![CDATA[SQL distinct clause is used to remove duplicate rows from database table name. distinct keyword can be used on one column name and more than one column name in SQL query. distinct clause can be implemented in MySQL, oracle, db2, Microsoft SQL server.
SQL distinct query example explains how to use distinct query in SQL.
Table class_name [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fsql-select-distinct-example-distinct-clause%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fsql-select-distinct-example-distinct-clause%2F" height="61" width="51" /></a></div><p>SQL distinct clause is used to remove duplicate rows from database table name. distinct keyword can be used on one column name and more than one column name in SQL query. distinct clause can be implemented in MySQL, oracle, db2, Microsoft SQL server.</p>
<p>SQL distinct query example explains how to use distinct query in SQL.</p>
<p>Table class_name with all records without desired column name sorting</p>
<div class="cde">
<p class="op">
<pre>
+---------+-------------+------------+------------+
| Roll_No | Name        | Class_Name | Year_Start |
+---------+-------------+------------+------------+
|       1 | Amit Mishra | B.Science  |       2005 |
|       2 | Robot       | B.Tech     |       2005 |
|       3 | Rohan       | M.Tech     |       2005 |
|       4 | Vivek       | B.Tech     |       2009 |
|       5 | Chander     | B.Science  |       2009 |
|       6 | Deepak      | B.Science  |       2009 |
|       7 | Gagan Deep  | B.Tech     |       NULL |
|       8 | Mohit Garg  | M.Tech     |       NULL |
+---------+-------------+------------+------------+
</pre>
</p>
</div>
<p><strong>syntax of SQL distinct </strong></p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>SELECT</span> <span style='color:#800000; font-weight:bold; '>distinct</span> <span style='color:#800000; font-weight:bold; '>columns</span> <span style='color:#800000; font-weight:bold; '>FROM</span> table_name
</pre>
</div>
<p><strong>distinct  examples</strong></p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>SELECT</span> <span style='color:#800000; font-weight:bold; '>distinct</span> Roll_No<span style='color:#800080; '>,</span> Name<span style='color:#800080; '>,</span> Class_Name<span style='color:#800080; '>,</span> Year_Start <span style='color:#800000; font-weight:bold; '>FROM</span> class_name c<span style='color:#800080; '>;</span>
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
<pre>
+---------+-------------+------------+------------+
| Roll_No | Name        | Class_Name | Year_Start |
+---------+-------------+------------+------------+
|       1 | Amit Mishra | B.Science  |       2005 |
|       2 | Robot       | B.Tech     |       2005 |
|       3 | Rohan       | M.Tech     |       2005 |
|       4 | Vivek       | B.Tech     |       2009 |
|       5 | Chander     | B.Science  |       2009 |
|       6 | Deepak      | B.Science  |       2009 |
|       7 | Gagan Deep  | B.Tech     |       NULL |
|       8 | Mohit Garg  | M.Tech     |       NULL |
+---------+-------------+------------+------------+
</pre>
</p>
</div>
<p>this SQL query returns all rows return because no duplicate row is found. all column name is distinct</p>
<p></p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>SELECT</span> <span style='color:#800000; font-weight:bold; '>distinct</span> Class_Name<span style='color:#800080; '>,</span> Year_Start <span style='color:#800000; font-weight:bold; '>FROM</span> class_name<span style='color:#800080; '>;</span>
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
<pre>
+------------+------------+
| Class_Name | Year_Start |
+------------+------------+
| B.Science  |       2005 |
| B.Tech     |       2005 |
| M.Tech     |       2005 |
| B.Tech     |       2009 |
| B.Science  |       2009 |
| B.Tech     |       NULL |
| M.Tech     |       NULL |
+------------+------------+
</pre>
</p>
</div>
<p>this SQL query returns those row which column name (Class_Name, Year_Start) not duplicate rows value only from table.</p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>SELECT</span> <span style='color:#800000; font-weight:bold; '>distinct</span> Class_Name <span style='color:#800000; font-weight:bold; '>FROM</span> class_name<span style='color:#800080; '>;</span>
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
<pre>
+------------+
| Class_Name |
+------------+
| B.Science  |
| B.Tech     |
| M.Tech     |
+------------+
</pre>
</p>
</div>
<p>this SQL query check distinct on only one column name Class_Name and check duplicate rows in  Class_Name column name and remove duplicate rows.</p>
<p>* indicates fetch all columns records from table.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/sql-select-distinct-example-distinct-clause/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL &#8211; Select is null Example, is not null Example</title>
		<link>http://www.easywayserver.com/blog/sql-select-is-null-example-is-not-null-example/</link>
		<comments>http://www.easywayserver.com/blog/sql-select-is-null-example-is-not-null-example/#comments</comments>
		<pubDate>Sat, 28 Nov 2009 07:52:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Select]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/sql-select-is-null-example-is-not-null-example/</guid>
		<description><![CDATA[SQL is null clause, is not null clause option can filter records from database table name on null value in rows. This returns only null rows which we put is null clause in query, and returns those rows which not having null in row on is not null clause. null keyword can be used on [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fsql-select-is-null-example-is-not-null-example%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fsql-select-is-null-example-is-not-null-example%2F" height="61" width="51" /></a></div><p>SQL is null clause, is not null clause option can filter records from database table name on null value in rows. This returns only null rows which we put is null clause in query, and returns those rows which not having null in row on is not null clause. null keyword can be used on one column name and more than one column name in SQL query. null clause can be implemented in MySQL, oracle, db2, Microsoft SQL server.</p>
<p>SQL null query example explains how to use null query in SQL.</p>
<p>Table class_name with all records without desired column name sorting</p>
<div class="cde">
<p class="op">
<pre>
+---------+-------------+------------+------------+
| Roll_No | Name        | Class_Name | Year_Start |
+---------+-------------+------------+------------+
|       1 | Amit Mishra | B.Science  |       2005 |
|       2 | Robot       | B.Tech     |       2005 |
|       3 | Rohan       | M.Tech     |       2005 |
|       4 | Vivek       | B.Tech     |       2009 |
|       5 | Chander     | B.Science  |       2009 |
|       6 | Deepak      | B.Science  |       2009 |
|       7 | Gagan Deep  | B.Tech     |       NULL |
|       8 | Mohit Garg  | M.Tech     |       NULL |
+---------+-------------+------------+------------+
</pre>
</p>
</div>
<p><strong>Where clause</strong></p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>SELECT</span> <span style='color:#800080; '>*</span> <span style='color:#800000; font-weight:bold; '>FROM</span> class_name  <span style='color:#800000; font-weight:bold; '>where</span> Year_Start <span style='color:#800000; font-weight:bold; '>is</span> <span style='color:#808030; '>null</span><span style='color:#800080; '>;</span>
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
<pre>
+---------+------------+------------+------------+
| Roll_No | Name       | Class_Name | Year_Start |
+---------+------------+------------+------------+
|       7 | Gagan Deep | B.Tech     |       NULL |
|       8 | Mohit Garg | M.Tech     |       NULL |
+---------+------------+------------+------------+
</pre>
</p>
</div>
<p>this SQL query returns those row which column name (Year_Start) having null value only from table.</p>
<p></p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>SELECT</span> <span style='color:#800080; '>*</span> <span style='color:#800000; font-weight:bold; '>FROM</span> class_name  <span style='color:#800000; font-weight:bold; '>where</span> Year_Start <span style='color:#800000; font-weight:bold; '>is</span> <span style='color:#808030; '>not</span> <span style='color:#808030; '>null</span><span style='color:#800080; '>;</span>
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
<pre>
+---------+-------------+------------+------------+
| Roll_No | Name        | Class_Name | Year_Start |
+---------+-------------+------------+------------+
|       1 | Amit Mishra | B.Science  |       2005 |
|       2 | Robot       | B.Tech     |       2005 |
|       3 | Rohan       | M.Tech     |       2005 |
|       4 | Vivek       | B.Tech     |       2009 |
|       5 | Chander     | B.Science  |       2009 |
|       6 | Deepak      | B.Science  |       2009 |
+---------+-------------+------------+------------+
</pre>
</p>
</div>
<p>this SQL query returns those row which column name (Year_Start) not having null value only from table.</p>
<p>* indicates fetch all columns records from table.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/sql-select-is-null-example-is-not-null-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL &#8211; Select Where clause Example</title>
		<link>http://www.easywayserver.com/blog/sql-select-where-clause-example/</link>
		<comments>http://www.easywayserver.com/blog/sql-select-where-clause-example/#comments</comments>
		<pubDate>Sat, 28 Nov 2009 07:25:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Select]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/sql-select-where-clause-example/</guid>
		<description><![CDATA[SQL where clause option can filter records from database table name. This returns only required rows which we put clause in query. where keyword can be used on one column name and more than one column name in SQL query. where clause can be implemented in MySQL, oracle, db2, Microsoft SQL server.
SQL select where query [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fsql-select-where-clause-example%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fsql-select-where-clause-example%2F" height="61" width="51" /></a></div><p>SQL where clause option can filter records from database table name. This returns only required rows which we put clause in query. where keyword can be used on one column name and more than one column name in SQL query. where clause can be implemented in MySQL, oracle, db2, Microsoft SQL server.</p>
<p>SQL select where query example explains how to use select where query in SQL.</p>
<p>Table class_name with all records without desired column name sorting</p>
<div class="cde">
<p class="op">
<pre>
+---------+-------------+------------+------------+
| Roll_No | Name        | Class_Name | Year_Start |
+---------+-------------+------------+------------+
|       1 | Amit Mishra | B.Science  |       2005 |
|       2 | Robot       | B.Tech     |       2005 |
|       3 | Rohan       | M.Tech     |       2005 |
|       4 | Vivek       | B.Tech     |       2009 |
|       5 | Chander     | B.Science  |       2009 |
|       6 | Deepak      | B.Science  |       2009 |
+---------+-------------+------------+------------+
</pre>
</p>
</div>
<p><strong>Where clause</strong></p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>SELECT</span> <span style='color:#800080; '>*</span> <span style='color:#800000; font-weight:bold; '>FROM</span> class_name c <span style='color:#800000; font-weight:bold; '>where</span> Year_Start <span style='color:#808030; '>=</span> <span style='color:#008c00; '>2005</span><span style='color:#800080; '>;</span>
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
<pre>
+---------+-------------+------------+------------+
| Roll_No | Name        | Class_Name | Year_Start |
+---------+-------------+------------+------------+
|       1 | Amit Mishra | B.Science  |       2005 |
|       2 | Robot       | B.Tech     |       2005 |
|       3 | Rohan       | M.Tech     |       2005 |
+---------+-------------+------------+------------+
</pre>
</p>
</div>
<p>this SQL query returns those row which column name (Year_Start) having 2005 value only from table.</p>
<p></p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>select</span> <span style='color:#800080; '>*</span> <span style='color:#800000; font-weight:bold; '>from</span> class_name <span style='color:#800000; font-weight:bold; '>where</span> Year_Start <span style='color:#808030; '>></span> <span style='color:#008c00; '>2005</span><span style='color:#800080; '>;</span>
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
<pre>
+---------+---------+------------+------------+
| Roll_No | Name    | Class_Name | Year_Start |
+---------+---------+------------+------------+
|       4 | Vivek   | B.Tech     |       2009 |
|       5 | Chander | B.Science  |       2009 |
|       6 | Deepak  | B.Science  |       2009 |
+---------+---------+------------+------------+
</pre>
</p>
</div>
<p>this SQL query returns only those row in column Year_Start greater than 2005 value only.</p>
<p><strong>group by on more than one column name</strong></p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>SELECT</span> <span style='color:#800080; '>*</span> <span style='color:#800000; font-weight:bold; '>FROM</span> class_name c
   <span style='color:#800000; font-weight:bold; '>where</span> Year_Start<span style='color:#808030; '>=</span> <span style='color:#008c00; '>2005</span> <span style='color:#808030; '>and</span> Class_Name <span style='color:#808030; '>=</span> <span style='color:#0000e6; '>'B.Tech'</span><span style='color:#800080; '>;</span>
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
<pre>
+---------+-------+------------+------------+
| Roll_No | Name  | Class_Name | Year_Start |
+---------+-------+------------+------------+
|       2 | Robot | B.Tech     |       2005 |
+---------+-------+------------+------------+
</pre>
</p>
</div>
<p>this SQL query returns only those row in column Year_Start having 2005 value only and also class_name column value having B.Tech.</p>
<p>* indicates fetch all columns records from table.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/sql-select-where-clause-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL &#8211; Select Group By Example, Group by statement</title>
		<link>http://www.easywayserver.com/blog/sql-select-group-by-example-group-by-statement/</link>
		<comments>http://www.easywayserver.com/blog/sql-select-group-by-example-group-by-statement/#comments</comments>
		<pubDate>Sat, 28 Nov 2009 06:56:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Select]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/?p=441</guid>
		<description><![CDATA[SQL Group by column name clause is used to give aggregate records in database table. Group by keyword is used to give records in same column rows in grouped manner. Group by can be used on one column name and more than one column name in SQL query. group by can be implemented in MySQL, [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fsql-select-group-by-example-group-by-statement%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fsql-select-group-by-example-group-by-statement%2F" height="61" width="51" /></a></div><p>SQL Group by column name clause is used to give aggregate records in database table. Group by keyword is used to give records in same column rows in grouped manner. Group by can be used on one column name and more than one column name in SQL query. group by can be implemented in MySQL, oracle, db2, Microsoft SQL server.</p>
<p>SQL select Group by query example explains how to use select Group by query in SQL.</p>
<p>Table class_name with all records without desired column name sorting</p>
<div class="cde">
<p class="op">
<pre>
+---------+-------------+------------+------------+
| Roll_No | Name        | Class_Name | Year_Start |
+---------+-------------+------------+------------+
|       1 | Amit Mishra | B.Science  |       2005 |
|       2 | Robot       | B.Tech     |       2005 |
|       3 | Rohan       | M.Tech     |       2005 |
|       4 | Vivek       | B.Tech     |       2009 |
|       5 | Chander     | B.Science  |       2009 |
|       6 | Deepak      | B.Science  |       2009 |
+---------+-------------+------------+------------+
</pre>
</p>
</div>
<p><strong>Group by</strong></p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>SELECT</span> <span style='color:#800080; '>*</span> <span style='color:#800000; font-weight:bold; '>FROM</span> class_name c <span style='color:#800000; font-weight:bold; '>group</span> <span style='color:#800000; font-weight:bold; '>by</span> Class_Name<span style='color:#800080; '>;</span>
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
<pre>
+---------+-------------+------------+------------+
| Roll_No | Name        | Class_Name | Year_Start |
+---------+-------------+------------+------------+
|       1 | Amit Mishra | B.Science  |       2005 |
|       2 | Robot       | B.Tech     |       2005 |
|       3 | Rohan       | M.Tech     |       2005 |
+---------+-------------+------------+------------+
</pre>
</p>
</div>
<p>this SQL query returns unique column name (class_name) rows only from table.</p>
<p></p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>SELECT</span> Roll_No<span style='color:#800080; '>,</span> Name<span style='color:#800080; '>,</span> Class_Name<span style='color:#800080; '>,</span> <span style='color:#400000; '>count</span><span style='color:#808030; '>(</span>Class_Name<span style='color:#808030; '>)</span>
           <span style='color:#800000; font-weight:bold; '>FROM</span> class_name c <span style='color:#800000; font-weight:bold; '>group</span> <span style='color:#800000; font-weight:bold; '>by</span> Class_Name<span style='color:#800080; '>;</span>
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
<pre>
+---------+-------------+------------+-------------------+
| Roll_No | Name        | Class_Name | count(Class_Name) |
+---------+-------------+------------+-------------------+
|       1 | Amit Mishra | B.Science  |                 3 |
|       2 | Robot       | B.Tech     |                 2 |
|       3 | Rohan       | M.Tech     |                 1 |
+---------+-------------+------------+-------------------+
</pre>
</p>
</div>
<p>this SQL query returns unique column name (class_name) rows only from table and it shows count of unique column name.</p>
<p><strong>group by on more than one column name</strong></p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>SELECT</span> <span style='color:#800080; '>*</span> <span style='color:#800000; font-weight:bold; '>FROM</span> class_name c <span style='color:#800000; font-weight:bold; '>group</span> <span style='color:#800000; font-weight:bold; '>by</span> Class_Name<span style='color:#800080; '>,</span>Year_Start<span style='color:#800080; '>;</span>
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
<pre>
+---------+-------------+------------+------------+
| Roll_No | Name        | Class_Name | Year_Start |
+---------+-------------+------------+------------+
|       1 | Amit Mishra | B.Science  |       2005 |
|       5 | Chander     | B.Science  |       2009 |
|       2 | Robot       | B.Tech     |       2005 |
|       4 | Vivek       | B.Tech     |       2009 |
|       3 | Rohan       | M.Tech     |       2005 |
+---------+-------------+------------+------------+
</pre>
</p>
</div>
<p>this SQL query returns, unique column name rows only with two columns</p>
<p>* indicates fetch all columns records from table.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/sql-select-group-by-example-group-by-statement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL &#8211; Select Order by clause keyword</title>
		<link>http://www.easywayserver.com/blog/sql-select-order-by-clause-keyword/</link>
		<comments>http://www.easywayserver.com/blog/sql-select-order-by-clause-keyword/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 15:16:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Select]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/sql-select-order-by-clause-keyword/</guid>
		<description><![CDATA[SQL select query is used to fetch records from database. order by column name clause is used to sorting records in database table. Order by keyword is having options for sorting data records, one is ascending sorting order, Second is descending order, it will return records in higher to lower order. In ascending sorting order, [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fsql-select-order-by-clause-keyword%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fsql-select-order-by-clause-keyword%2F" height="61" width="51" /></a></div><p>SQL select query is used to fetch records from database. order by column name clause is used to sorting records in database table. Order by keyword is having options for sorting data records, one is ascending sorting order, Second is descending order, it will return records in higher to lower order. In ascending sorting order, it returns records in lower to higher order. order by clause can be implemented on all database Oracle, MS Sql (Microsoft SQL), MySQL.</p>
<p>SQL select order by query example explains how to use select order by query in SQL.</p>
<p>Table class_name with all records without desired column name sorting</p>
<div class="cde">
<p class="op">
<pre>
+---------+-------------+------------+------------+
| Roll_No | Name        | Class_Name | Year_Start |
+---------+-------------+------------+------------+
|       1 | Amit Mishra | B Science  |       2005 |
|       2 | Robot       | B.Tech     |       2005 |
|       3 | Rohan       | M.Tech     |       2005 |
|       4 | Vivek       | B.Tech     |       2009 |
|       5 | Chander     | B.Science  |       2009 |
|       6 | Deepak      | B.Science  |       2009 |
+---------+-------------+------------+------------+
</pre>
</p>
</div>
<p><strong>Descending Order by Sorting</strong></p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>SELECT</span> <span style='color:#800080; '>*</span> <span style='color:#800000; font-weight:bold; '>FROM</span> class_name c <span style='color:#800000; font-weight:bold; '>order</span> <span style='color:#800000; font-weight:bold; '>by</span> name <span style='color:#800000; font-weight:bold; '>desc</span><span style='color:#800080; '>;</span>
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
<pre>
+---------+-------------+------------+------------+
| Roll_No | Name        | Class_Name | Year_Start |
+---------+-------------+------------+------------+
|       4 | Vivek       | B.Tech     |       2009 |
|       3 | Rohan       | M.Tech     |       2005 |
|       2 | Robot       | B.Tech     |       2005 |
|       6 | Deepak      | B.Science  |       2009 |
|       5 | Chander     | B.Science  |       2009 |
|       1 | Amit Mishra | B Science  |       2005 |
+---------+-------------+------------+------------+
</pre>
</p>
</div>
<p>this SQL query in sql return rows from higher to lower sorting order from table.</p>
<p></p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>SELECT</span> <span style='color:#800080; '>*</span> <span style='color:#800000; font-weight:bold; '>FROM</span> class_name c <span style='color:#800000; font-weight:bold; '>order</span> <span style='color:#800000; font-weight:bold; '>by</span> name <span style='color:#800000; font-weight:bold; '>asc</span><span style='color:#800080; '>;</span>
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
<pre>
+---------+-------------+------------+------------+
| Roll_No | Name        | Class_Name | Year_Start |
+---------+-------------+------------+------------+
|       1 | Amit Mishra | B Science  |       2005 |
|       5 | Chander     | B.Science  |       2009 |
|       6 | Deepak      | B.Science  |       2009 |
|       2 | Robot       | B.Tech     |       2005 |
|       3 | Rohan       | M.Tech     |       2005 |
|       4 | Vivek       | B.Tech     |       2009 |
+---------+-------------+------------+------------+
</pre>
</p>
</div>
<p>this SQL query in sql return rows from lower to higher sorting order from table.</p>
<p>* indicates fetch all columns records from table.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/sql-select-order-by-clause-keyword/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL &#8211; Select with Temporary Dual table</title>
		<link>http://www.easywayserver.com/blog/sql-select-with-temporary-dual-table/</link>
		<comments>http://www.easywayserver.com/blog/sql-select-with-temporary-dual-table/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 11:11:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Select]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/?p=429</guid>
		<description><![CDATA[SQL select query is used to fetch records from database. Dual table is Temporary table which is created for temporary work. Dual table allow people to use from keyword in query.
SQL select dual example explains how to use select dual query in SQL.

select 3+1 from dual;


Table dual with records



+-----+
&#124; 3+1 &#124;
+-----+
&#124;   4 &#124;
+-----+



]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fsql-select-with-temporary-dual-table%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fsql-select-with-temporary-dual-table%2F" height="61" width="51" /></a></div><p>SQL select query is used to fetch records from database. Dual table is Temporary table which is created for temporary work. Dual table allow people to use from keyword in query.</p>
<p>SQL select dual example explains how to use select dual query in SQL.</p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>select</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>+</span><span style='color:#008c00; '>1</span> <span style='color:#800000; font-weight:bold; '>from</span> dual<span style='color:#800080; '>;</span>
</pre>
</div>
<p>Table dual with records</p>
<div class="cde">
<p class="op">
<pre>
+-----+
| 3+1 |
+-----+
|   4 |
+-----+
</pre>
</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/sql-select-with-temporary-dual-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL &#8211; Select with limit rows and records Clause Example, Oracle MS SQL MySQL</title>
		<link>http://www.easywayserver.com/blog/sql-select-with-limit-rows-and-records-clause-example-oracle-ms-sql-mysql/</link>
		<comments>http://www.easywayserver.com/blog/sql-select-with-limit-rows-and-records-clause-example-oracle-ms-sql-mysql/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 10:58:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Select]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/sql-select-with-limit-rows-and-records-clause-example-oracle-ms-sql-mysql/</guid>
		<description><![CDATA[SQL select query is used to fetch records from database. limit clause is used to get limited rows from database table. Limit is implemented differently with different database Oracle, MS Sql, MySQL.
SQL select limit query example explains how to use select limit query in SQL.
Table class_name with all records



+---------+-------------+------------+------------+
&#124; Roll_No &#124; Name    [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fsql-select-with-limit-rows-and-records-clause-example-oracle-ms-sql-mysql%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fsql-select-with-limit-rows-and-records-clause-example-oracle-ms-sql-mysql%2F" height="61" width="51" /></a></div><p>SQL select query is used to fetch records from database. limit clause is used to get limited rows from database table. Limit is implemented differently with different database Oracle, MS Sql, MySQL.</p>
<p>SQL select limit query example explains how to use select limit query in SQL.</p>
<p>Table class_name with all records</p>
<div class="cde">
<p class="op">
<pre>
+---------+-------------+------------+------------+
| Roll_No | Name        | Class_Name | Year_Start |
+---------+-------------+------------+------------+
|       1 | Amit Mishra | B Science  |       2005 |
|       2 | Robot       | B.Tech     |       2005 |
|       3 | Rohan       | M.Tech     |       2005 |
|       4 | Vivek       | B.Tech     |       2009 |
|       5 | Chander     | B.Science  |       2009 |
|       6 | Deepak      | B.Science  |       2009 |
+---------+-------------+------------+------------+
</pre>
</p>
</div>
<p><strong>In MySQL, limit keyword</strong></p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>select</span> <span style='color:#800080; '>*</span> <span style='color:#800000; font-weight:bold; '>from</span> class_name <span style='color:#800000; font-weight:bold; '>limit</span> <span style='color:#008c00; '>4</span><span style='color:#800080; '>;</span>
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
<pre>
+---------+-------------+------------+------------+
| Roll_No | Name        | Class_Name | Year_Start |
+---------+-------------+------------+------------+
|       1 | Amit Mishra | B Science  |       2005 |
|       2 | Robot       | B.Tech     |       2005 |
|       3 | Rohan       | M.Tech     |       2005 |
|       4 | Vivek       | B.Tech     |       2009 |
+---------+-------------+------------+------------+
</pre>
</p>
</div>
<p>this SQL query in mysql return only top 4 rows from table.</p>
<p></p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>select</span> <span style='color:#800080; '>*</span> <span style='color:#800000; font-weight:bold; '>from</span> class_name <span style='color:#800000; font-weight:bold; '>limit</span> <span style='color:#008c00; '>2</span><span style='color:#800080; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#800080; '>;</span>
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
<pre>
+---------+---------+------------+------------+
| Roll_No | Name    | Class_Name | Year_Start |
+---------+---------+------------+------------+
|       3 | Rohan   | M.Tech     |       2005 |
|       4 | Vivek   | B.Tech     |       2009 |
|       5 | Chander | B.Science  |       2009 |
|       6 | Deepak  | B.Science  |       2009 |
+---------+---------+------------+------------+
</pre>
</p>
</div>
<p>this SQL query in mysql returns only rows start after top 2 and get only 4 rows.</p>
<p><strong>In Oracle, limits rows by rownum keyword in SQL query</strong> </p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>select</span> <span style='color:#800080; '>*</span> <span style='color:#800000; font-weight:bold; '>from</span> class_name rownum <span style='color:#808030; '>&lt;=</span><span style='color:#008c00; '>4</span><span style='color:#800080; '>;</span>
</pre>
</div>
<p>this Oracle SQL query returns only top 4 rows from table</p>
<p><strong>In Microsoft SQL, limits rows by top keyword in SQL query</strong></p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>select</span> top <span style='color:#008c00; '>4</span> column_names <span style='color:#800000; font-weight:bold; '>from</span> class_name<span style='color:#800080; '>;</span>
</pre>
</div>
<p>this Mircrosoft SQL query returns only top 4 rows from table</p>
<p>* indicates fetch all columns records from table.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/sql-select-with-limit-rows-and-records-clause-example-oracle-ms-sql-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL &#8211; Select Query with Clause Example</title>
		<link>http://www.easywayserver.com/blog/sql-select-query-with-clause-example/</link>
		<comments>http://www.easywayserver.com/blog/sql-select-query-with-clause-example/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 07:46:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Select]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/sql-select-query-with-clause-example/</guid>
		<description><![CDATA[SQL select query is used to fetch records from database. Select can use with clause and without clause. Select query returns number of rows from table. Select query can allow clause with where keyword. where clause is used for filter rows in database table.
SQL select clause query example explains how to use select clause query [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fsql-select-query-with-clause-example%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fsql-select-query-with-clause-example%2F" height="61" width="51" /></a></div><p>SQL select query is used to fetch records from database. Select can use with clause and without clause. Select query returns number of rows from table. Select query can allow clause with where keyword. where clause is used for filter rows in database table.</p>
<p>SQL select clause query example explains how to use select clause query in SQL.</p>
<p>Table class_name with all records</p>
<div class="cde">
<p class="op">
<pre>
+---------+-------------+------------+------------+
| Roll_No | Name        | Class_Name | Year_Start |
+---------+-------------+------------+------------+
|       1 | Amit Mishra | B Science  |       2005 |
|       2 | Robot       | B.Tech     |       2005 |
|       3 | Rohan       | M.Tech     |       2005 |
|       4 | Vivek       | B.Tech     |       2009 |
|       5 | Chander     | B.Science  |       2009 |
|       6 | Deepak      | B.Science  |       2009 |
+---------+-------------+------------+------------+
</pre>
</p>
</div>
<p><strong>where clause to find equals to </strong></p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>select</span> <span style='color:#800080; '>*</span> <span style='color:#800000; font-weight:bold; '>from</span> class_name <span style='color:#800000; font-weight:bold; '>where</span> Class_Name <span style='color:#808030; '>=</span> <span style='color:#0000e6; '>'B.Tech'</span><span style='color:#800080; '>;</span>
</pre>
</div>
<p></p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>select</span> <span style='color:#800080; '>*</span> <span style='color:#800000; font-weight:bold; '>from</span> class_name <span style='color:#800000; font-weight:bold; '>where</span> Class_Name <span style='color:#808030; '>&lt;=></span> <span style='color:#0000e6; '>'B.Tech'</span><span style='color:#800080; '>;</span>
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
<pre>
+---------+-------+------------+------------+
| Roll_No | Name  | Class_Name | Year_Start |
+---------+-------+------------+------------+
|       2 | Robot | B.Tech     |       2005 |
|       4 | Vivek | B.Tech     |       2009 |
+---------+-------+------------+------------+
</pre>
</p>
</div>
<p>returns only those row having class_name with B.Tech only</p>
<p><strong>where clause to find not equals to</strong> </p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>select</span> <span style='color:#800080; '>*</span> <span style='color:#800000; font-weight:bold; '>from</span> class_name <span style='color:#800000; font-weight:bold; '>where</span> Class_Name <span style='color:#808030; '>!=</span> <span style='color:#0000e6; '>'B.Tech'</span><span style='color:#800080; '>;</span>
</pre>
</div>
<p></p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>select</span> <span style='color:#800080; '>*</span> <span style='color:#800000; font-weight:bold; '>from</span> class_name <span style='color:#800000; font-weight:bold; '>where</span> Class_Name <span style='color:#808030; '>&lt;></span> <span style='color:#0000e6; '>'B.Tech'</span><span style='color:#800080; '>;</span>
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
<pre>
+---------+-------------+------------+------------+
| Roll_No | Name        | Class_Name | Year_Start |
+---------+-------------+------------+------------+
|       1 | Amit Mishra | B Science  |       2005 |
|       3 | Rohan       | M.Tech     |       2005 |
|       5 | Chander     | B.Science  |       2009 |
|       6 | Deepak      | B.Science  |       2009 |
+---------+-------------+------------+------------+
</pre>
</p>
</div>
<p>returns only those row not having class_name with B.Tech only</p>
<p><strong>where clause to find less than  to</strong></p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>select</span> <span style='color:#800080; '>*</span> <span style='color:#800000; font-weight:bold; '>from</span> class_name <span style='color:#800000; font-weight:bold; '>where</span> Year_Start <span style='color:#808030; '>&lt;</span> <span style='color:#008c00; '>2009</span><span style='color:#800080; '>;</span>
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
<pre>
+---------+-------------+------------+------------+
| Roll_No | Name        | Class_Name | Year_Start |
+---------+-------------+------------+------------+
|       1 | Amit Mishra | B Science  |       2005 |
|       2 | Robot       | B.Tech     |       2005 |
|       3 | Rohan       | M.Tech     |       2005 |
+---------+-------------+------------+------------+
</pre>
</p>
</div>
<p>returns only those row in column Year_Start less than 2009 value only</p>
<p><strong>where clause to find greater than  to</strong></p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>select</span> <span style='color:#800080; '>*</span> <span style='color:#800000; font-weight:bold; '>from</span> class_name <span style='color:#800000; font-weight:bold; '>where</span> Year_Start <span style='color:#808030; '>></span> <span style='color:#008c00; '>2005</span><span style='color:#800080; '>;</span>
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
<pre>
+---------+---------+------------+------------+
| Roll_No | Name    | Class_Name | Year_Start |
+---------+---------+------------+------------+
|       4 | Vivek   | B.Tech     |       2009 |
|       5 | Chander | B.Science  |       2009 |
|       6 | Deepak  | B.Science  |       2009 |
+---------+---------+------------+------------+
</pre>
</p>
</div>
<p>returns only those row in column Year_Start greater than 2005 value only</p>
<p>* indicates fetch all columns records from table.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/sql-select-query-with-clause-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
