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
Pure VPN - Up to 27 Months
vgp
Updated:
Friday at 8:10 AM
එක පැකේජ් එකයි මාසෙටම Unlimited Internet. තාමත් DATA CARD දාන්න සල්ලි වියදම් කරනවද? අඩුම මිලට අපෙන්.
sayuru bandara
Updated:
Jun 2, 2026
Ad icon
ඉන්ටර්නෙට් එකෙන් හරියටම සල්ලි හොයන්න සහ Success වෙන්න කැමතිද? 🚀 (E-Money & Success Stories)
siri sumana
Updated:
May 30, 2026
Gemini AI PRO 18 months Offer
Hawaka
Updated:
May 27, 2026
Ad icon
koko account
DasunEranga
Updated:
May 27, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
Computers & Internet
Software Development
MySQL Pivot Table
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="ArunaTelshan" data-source="post: 23456570" data-attributes="member: 495249"><p><span style="font-size: 12px"><span style="color: #581845"></span></span></p><p><span style="font-size: 12px"><span style="color: #581845">katahari puluwanda mata meka php walata harawala denna..</span></span></p><p><span style="font-size: 12px"><span style="color: #581845"></span></span></p><p></p><p>[CODE]SET @sql = NULL;</p><p>SELECT</p><p> GROUP_CONCAT(DISTINCT</p><p> CONCAT(</p><p> 'SUM(CASE WHEN MonthYear = ''',</p><p> MonthYear,</p><p> ''' THEN total ELSE 0 END) AS ',</p><p> MonthYear</p><p> )</p><p> ) INTO @sql</p><p>FROM (</p><p> SELECT</p><p> cid,</p><p> DATE_FORMAT(duedate, '%b_%y') MonthYear,</p><p> total</p><p> FROM invoices</p><p> WHERE duedate BETWEEN CAST('2013-01-01' AS DATE) AND CAST('2013-07-31' AS DATE)</p><p> ORDER BY duedate</p><p>) src;</p><p></p><p>SET @sql = CONCAT("SELECT cid, ", @sql, "</p><p> FROM (</p><p> SELECT</p><p> cid,</p><p> DATE_FORMAT(duedate, '%b_%y') MonthYear,</p><p> total</p><p> FROM invoices</p><p> WHERE duedate BETWEEN CAST('2013-01-01' AS DATE) AND CAST('2013-07-31' AS DATE)</p><p> ORDER BY duedate</p><p> ) src</p><p> GROUP BY cid");</p><p></p><p>PREPARE stmt FROM @sql;</p><p>EXECUTE stmt;</p><p>DEALLOCATE PREPARE stmt;[/CODE]</p><p></p><p><span style="font-size: 12px"><span style="color: #581845"></span></span></p><p><span style="font-size: 12px"><span style="color: #581845"></span></span></p><p><span style="font-size: 12px"><span style="color: #581845">$query = "SQL QUERY";</span></span></p><p><span style="font-size: 12px"><span style="color: #581845">$result = mysqli_query($connection,$query);</span></span></p><p><span style="font-size: 12px"><span style="color: #581845"></span></span></p><p><span style="font-size: 12px"><span style="color: #581845">me widiyata run karanna puluwan wena widiyata</span></span></p><p><span style="font-size: 12px"><span style="color: #581845"></span></span></p><p><span style="font-size: 12px"><span style="color: #581845"></span></span></p></blockquote><p></p>
[QUOTE="ArunaTelshan, post: 23456570, member: 495249"] [SIZE="3"][COLOR="#581845"] katahari puluwanda mata meka php walata harawala denna.. [/COLOR][/SIZE] [CODE]SET @sql = NULL; SELECT GROUP_CONCAT(DISTINCT CONCAT( 'SUM(CASE WHEN MonthYear = ''', MonthYear, ''' THEN total ELSE 0 END) AS ', MonthYear ) ) INTO @sql FROM ( SELECT cid, DATE_FORMAT(duedate, '%b_%y') MonthYear, total FROM invoices WHERE duedate BETWEEN CAST('2013-01-01' AS DATE) AND CAST('2013-07-31' AS DATE) ORDER BY duedate ) src; SET @sql = CONCAT("SELECT cid, ", @sql, " FROM ( SELECT cid, DATE_FORMAT(duedate, '%b_%y') MonthYear, total FROM invoices WHERE duedate BETWEEN CAST('2013-01-01' AS DATE) AND CAST('2013-07-31' AS DATE) ORDER BY duedate ) src GROUP BY cid"); PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;[/CODE] [SIZE="3"][COLOR="#581845"] $query = "SQL QUERY"; $result = mysqli_query($connection,$query); me widiyata run karanna puluwan wena widiyata [/COLOR][/SIZE] [/QUOTE]
Insert quotes…
Verification
Winadiyakata thappara keeyak tibeda?
Post reply
Top
Bottom