<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	
	>
<channel>
	<title>
	Comments on: SQL Puzzle: Find the upcoming Birthday for a Next Month	</title>
	<atom:link href="https://www.dbrnd.com/2018/05/sql-puzzle-find-the-upcoming-birthday-for-a-next-month/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com/2018/05/sql-puzzle-find-the-upcoming-birthday-for-a-next-month/</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Mon, 06 Jan 2020 16:57:23 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.4</generator>
	<item>
		<title>
		By: Hareesh		</title>
		<link>https://www.dbrnd.com/2018/05/sql-puzzle-find-the-upcoming-birthday-for-a-next-month/#comment-7996</link>

		<dc:creator><![CDATA[Hareesh]]></dc:creator>
		<pubDate>Mon, 06 Jan 2020 16:57:23 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=7522#comment-7996</guid>

					<description><![CDATA[select * from tbl_Employee
where MONTH(DOB) = MONTH(Getdate())+1]]></description>
			<content:encoded><![CDATA[<p>select * from tbl_Employee<br />
where MONTH(DOB) = MONTH(Getdate())+1</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: HIC		</title>
		<link>https://www.dbrnd.com/2018/05/sql-puzzle-find-the-upcoming-birthday-for-a-next-month/#comment-7049</link>

		<dc:creator><![CDATA[HIC]]></dc:creator>
		<pubDate>Sat, 27 Apr 2019 18:03:46 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=7522#comment-7049</guid>

					<description><![CDATA[select e1.*
from 
  tbl_Employee e1
where e1.dob = (  
  select min(e.dob) 
  from 
    tbl_Employee e
  where 
    add_months(e.dob, (EXTRACT(year FROM sysdate) - EXTRACT(year FROM e.dob)) * 12) &#062;= sysdate
);]]></description>
			<content:encoded><![CDATA[<p>select e1.*<br />
from<br />
  tbl_Employee e1<br />
where e1.dob = (<br />
  select min(e.dob)<br />
  from<br />
    tbl_Employee e<br />
  where<br />
    add_months(e.dob, (EXTRACT(year FROM sysdate) &#8211; EXTRACT(year FROM e.dob)) * 12) &gt;= sysdate<br />
);</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Dpan		</title>
		<link>https://www.dbrnd.com/2018/05/sql-puzzle-find-the-upcoming-birthday-for-a-next-month/#comment-6981</link>

		<dc:creator><![CDATA[Dpan]]></dc:creator>
		<pubDate>Mon, 15 Apr 2019 09:41:32 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=7522#comment-6981</guid>

					<description><![CDATA[;with BDay as (
select Empid,EmpName,DOb,DateDiff(dd,GETDATE(),stuff(Dob,1,4,2019)) as UpcomingDate from #tbl_employee
)
select Top 1 * from BDay where UpcomingDate&#062;0 Order by UpcomingDate]]></description>
			<content:encoded><![CDATA[<p>;with BDay as (<br />
select Empid,EmpName,DOb,DateDiff(dd,GETDATE(),stuff(Dob,1,4,2019)) as UpcomingDate from #tbl_employee<br />
)<br />
select Top 1 * from BDay where UpcomingDate&gt;0 Order by UpcomingDate</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: karthik		</title>
		<link>https://www.dbrnd.com/2018/05/sql-puzzle-find-the-upcoming-birthday-for-a-next-month/#comment-6771</link>

		<dc:creator><![CDATA[karthik]]></dc:creator>
		<pubDate>Thu, 01 Nov 2018 14:55:44 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=7522#comment-6771</guid>

					<description><![CDATA[select  EmpName ,DOB   from tbl_Employee where  datename(MONTH , DOB) = datename(MONTH , DATEADD( MONTH,1, getdate()))]]></description>
			<content:encoded><![CDATA[<p>select  EmpName ,DOB   from tbl_Employee where  datename(MONTH , DOB) = datename(MONTH , DATEADD( MONTH,1, getdate()))</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: aravind		</title>
		<link>https://www.dbrnd.com/2018/05/sql-puzzle-find-the-upcoming-birthday-for-a-next-month/#comment-6396</link>

		<dc:creator><![CDATA[aravind]]></dc:creator>
		<pubDate>Fri, 04 May 2018 17:42:35 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=7522#comment-6396</guid>

					<description><![CDATA[select *,current_date from employees where extract(&#039;month&#039; from  dob)&#062;=extract(&#039;month&#039; from  current_date::date) order by dob desc limit 1;]]></description>
			<content:encoded><![CDATA[<p>select *,current_date from employees where extract(&#8216;month&#8217; from  dob)&gt;=extract(&#8216;month&#8217; from  current_date::date) order by dob desc limit 1;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Dinesh		</title>
		<link>https://www.dbrnd.com/2018/05/sql-puzzle-find-the-upcoming-birthday-for-a-next-month/#comment-6395</link>

		<dc:creator><![CDATA[Dinesh]]></dc:creator>
		<pubDate>Fri, 04 May 2018 13:08:10 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=7522#comment-6395</guid>

					<description><![CDATA[--Methos-1
Select * From TBL_Employee
Where Convert(Date,Replace(Convert(VarChar,DOB),Year(DOB),Year(GetDate())))
Between Convert(Date,GetDate()) And Convert(Date,GetDate()+30)

--Method-2
Select * From TBL_Employee
Where Convert(Date,Convert(VarChar(4),Year(GetDate()))+Right(DOB,6)) Between Convert(Date,GetDate()) And Convert(Date,GetDate()+30)

--Method-3
Select * From TBL_Employee
Where Convert(Date,Convert(VarChar(4),Year(GetDate()))+&#039;/&#039;+Cast(Month(DOB) As VarChar(2))+&#039;/&#039;+Cast(Day(DOB) As VarChar(2))) Between Convert(Date,GetDate()) And Convert(Date,GetDate()+30)]]></description>
			<content:encoded><![CDATA[<p>&#8211;Methos-1<br />
Select * From TBL_Employee<br />
Where Convert(Date,Replace(Convert(VarChar,DOB),Year(DOB),Year(GetDate())))<br />
Between Convert(Date,GetDate()) And Convert(Date,GetDate()+30)</p>
<p>&#8211;Method-2<br />
Select * From TBL_Employee<br />
Where Convert(Date,Convert(VarChar(4),Year(GetDate()))+Right(DOB,6)) Between Convert(Date,GetDate()) And Convert(Date,GetDate()+30)</p>
<p>&#8211;Method-3<br />
Select * From TBL_Employee<br />
Where Convert(Date,Convert(VarChar(4),Year(GetDate()))+&#8217;/&#8217;+Cast(Month(DOB) As VarChar(2))+&#8217;/&#8217;+Cast(Day(DOB) As VarChar(2))) Between Convert(Date,GetDate()) And Convert(Date,GetDate()+30)</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
