Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
ඕනම රටකට සෙට් වෙන CV එකක්
ErMurazor
Updated:
Saturday at 9:50 AM
Hambantota
7 Acres Beachfront Land For Sell DownSouth , PerPerch Price 420 000
1024 Digital
Updated:
Wednesday at 11:57 AM
Baseus PI LITE INDOOR CAMERA
ErMurazor
Updated:
Oct 12, 2026
Ad icon
Colombo
Hard Disk For Sale
mazza
Updated:
Oct 10, 2026
land for sale
justasking
Updated:
Oct 10, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Talk!
SQL danna aya enna....
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="0cean" data-source="post: 22634583" data-attributes="member: 562898"><p>Thanks, machan.</p><p></p><p></p><p></p><p>Thanks machan. Query eka nam hari.</p><p></p><p>[CODE]declare @mytable table(id int, stname char(10), birthday date);</p><p>insert into @mytable values (1, 'saman', '2015.01.02')</p><p>insert into @mytable values (2, 'nimal', '2016.02.02')</p><p>insert into @mytable values (3, 'amal', '2017.05.02')</p><p>insert into @mytable values (4, 'kamal', '2015.09.02')</p><p>insert into @mytable values (5, 'nayana', '2015.08.02')</p><p></p><p>SELECT COUNT(DISTINCT birthday) </p><p>FROM @mytable</p><p>WHERE birthday>='2017-01-01' AND birthday<'2017-02-01'[/CODE]</p><p></p><p></p><p></p><p>Ow macahn.</p><p>Ela aniwa. kohomath program eke mita wada tikak wenas.</p><p>Ekata query eka liyana kota therum ganna wenawa.</p><p></p><p></p><p></p><p>Thanks machan. Wade nam hari.</p><p></p><p>Mama ube qury eka liyapu widiye mokakhari awulak thiyada...</p><p>Error ekak enawane...</p><p></p><p>[CODE]Msg 102, Level 15, State 1, Line 23</p><p>Incorrect syntax near ')'.</p><p>[/CODE]</p><p></p><p>[CODE]declare @mytable table(id int, stname char(10), birthday date);</p><p>insert into @mytable values (1, 'saman', '2015.01.02')</p><p>insert into @mytable values (2, 'nimal', '2016.02.02')</p><p>insert into @mytable values (3, 'amal', '2017.05.02')</p><p>insert into @mytable values (4, 'kamal', '2015.09.02')</p><p>insert into @mytable values (5, 'nayana', '2015.08.02')</p><p></p><p>DECLARE @year INT</p><p>SET @year = 2015</p><p></p><p>SELECT A.MonthName ,</p><p>ISNULL(B.RecCount,0) AS NoOfBirthdays</p><p>FROM ( SELECT number AS MonthNumber ,</p><p>DATENAME(MONTH,</p><p>CAST(@year * 100 + number AS VARCHAR) + '01') AS MonthName</p><p>FROM master.dbo.spt_values</p><p>WHERE ( type = 'P' )</p><p>AND ( number BETWEEN 1 AND 12 )</p><p>) AS A</p><p>LEFT OUTER JOIN ( SELECT COUNT(id) AS RecCount ,</p><p>MONTH(birthday) AS MonthNumber</p><p>FROM @mytable</p><p>GROUP BY MONTH(birthday)</p><p>[/CODE]</p></blockquote><p></p>
[QUOTE="0cean, post: 22634583, member: 562898"] Thanks, machan. Thanks machan. Query eka nam hari. [CODE]declare @mytable table(id int, stname char(10), birthday date); insert into @mytable values (1, 'saman', '2015.01.02') insert into @mytable values (2, 'nimal', '2016.02.02') insert into @mytable values (3, 'amal', '2017.05.02') insert into @mytable values (4, 'kamal', '2015.09.02') insert into @mytable values (5, 'nayana', '2015.08.02') SELECT COUNT(DISTINCT birthday) FROM @mytable WHERE birthday>='2017-01-01' AND birthday<'2017-02-01'[/CODE] Ow macahn. Ela aniwa. kohomath program eke mita wada tikak wenas. Ekata query eka liyana kota therum ganna wenawa. Thanks machan. Wade nam hari. Mama ube qury eka liyapu widiye mokakhari awulak thiyada... Error ekak enawane... [CODE]Msg 102, Level 15, State 1, Line 23 Incorrect syntax near ')'. [/CODE] [CODE]declare @mytable table(id int, stname char(10), birthday date); insert into @mytable values (1, 'saman', '2015.01.02') insert into @mytable values (2, 'nimal', '2016.02.02') insert into @mytable values (3, 'amal', '2017.05.02') insert into @mytable values (4, 'kamal', '2015.09.02') insert into @mytable values (5, 'nayana', '2015.08.02') DECLARE @year INT SET @year = 2015 SELECT A.MonthName , ISNULL(B.RecCount,0) AS NoOfBirthdays FROM ( SELECT number AS MonthNumber , DATENAME(MONTH, CAST(@year * 100 + number AS VARCHAR) + '01') AS MonthName FROM master.dbo.spt_values WHERE ( type = 'P' ) AND ( number BETWEEN 1 AND 12 ) ) AS A LEFT OUTER JOIN ( SELECT COUNT(id) AS RecCount , MONTH(birthday) AS MonthNumber FROM @mytable GROUP BY MONTH(birthday) [/CODE] [/QUOTE]
Insert quotes…
Verification
Asuwa dahayen wadi kalama keeyada?
Post reply
Top
Bottom