Blog Home / Tags : Test

SQL row sum

Given an SQL table

ID Amt
-- ---
1 100
2 200
3 300

Please write a MySQL statement to produce the following result:

ID Amt Total
-- --- -----
1 100 100
2 200 300
3 300 600

And here is an example SQL:

SELECT a.ID, a.Amt, sum(b.Amt) AS Total
F
Dept: SIDU | Read: 10069 | 2018-11-02
Tags: MySQL, Test

Finding the Nth Fibonacci number via PHP

Here is an example of Fibonacci numbers:

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, ...

Write a function f(x) so that return the following eg:

f(2) = 1
f(4) = 2
f(6) = 5
f(8) = 13 etc

And here is th
Dept: General | Read: 54622 | 2018-11-01
Tags: PHP, Test


Category

Top Tags

wiki, bug, test, CMS, feature, MySQL, blog, SIDU, forum, bank, ticket, news, PHP