₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,329,868 members, 8,442,677 topics. Date: Friday, 10 July 2026 at 01:26 PM

Toggle theme

BobAxelrod's Posts

Nairaland ForumBobAxelrod's ProfileBobAxelrod's Posts

1 (of 1 pages)

TV/MoviesRe: What Series Are You Watching Now? Part 2 by BobAxelrod: 1:59pm On Mar 04, 2018
LA CASA DE PAPEL
season 1& 2

BEST SERIES 9.0/10
PhonesFree 400 Naira Recharge Card by BobAxelrod(op): 11:12pm On Jan 30, 2018
coupon code - VICTOB183

TV/MoviesRe: What Series Are You Watching Now? Part 2 by BobAxelrod: 8:53pm On Nov 23, 2017
the punisher 9.2/10 �
ProgrammingRe: My Personal Page by BobAxelrod: 7:57pm On Sep 05, 2017
freecodecamp always provide a sample you can follow, I think you should follow that sample to get a better design.

as dmayor said you need to adjust the colors always , also the site isn't mobile responsive yet.

my personal page http://veektorh.github.io
ProgrammingRe: Please Someone Should Help Me With This Code. by BobAxelrod: 7:53pm On Sep 05, 2017
be more detailed, what is not reflecting in your js file?

won't it be better using jquery, vue, react etc?
ProgrammingRe: Vuejs Confirm Dialog Plugin by BobAxelrod: 7:48pm On Sep 05, 2017
good work bro
PhonesRe: How To Unlock Your Swift, Smile Etc MIFI To Use Ntel Sim. by BobAxelrod: 12:00pm On Aug 27, 2017
@Femi pls can this smile be unlocked?

Smile details

Model No. : M028AT
IMEI : 862075035495992
ProgrammingRe: Select All Rows Where The Sum Of Column Equals A Value by BobAxelrod(op): 8:12am On Dec 30, 2016
Viruses:
MSSQL SERVER:

select SimpleTable.col1 from SimpleTable where (select sum(SimpleTable.col2) from SimpleTable) = 17

PM me if it does not work.
Syntax error
ProgrammingRe: Select All Rows Where The Sum Of Column Equals A Value by BobAxelrod(op): 12:23am On Dec 26, 2016
Noblecx:
MSSQL
which result did you get after running dz query
ProgrammingRe: Select All Rows Where The Sum Of Column Equals A Value by BobAxelrod(op): 8:32pm On Dec 25, 2016
Noblecx:
This is what I was able to come up with.


Select col1, col2
From yourTable
Where sum = 5
IN
(Select col1, col2, (col1 + col2) as sum
From YourTable)

which database is this, not working for me
ProgrammingRe: Select All Rows Where The Sum Of Column Equals A Value by BobAxelrod(op): 8:29pm On Dec 25, 2016
Craigston:
How precise do you want the results to be? Do you want to carry out an exhaustive search of all such possible rows, and thus obtain every possible answer?
This seems like a combinatorial problem, and if you want an exhaustive enumeration of the problem, the cost of computing increases fast as the number of rows increases.
Also, are negative integers allowed in the rows? Are the number restricted to any set of numbers (integers, natural numbers, complex numbers, real numbers...).
I don't know how to implement this in a database, but you can do it in a program using a 1 x n matrix that maps to your table.

See these SO links, [1] and [2], for similar problems.
This problem is not one at which SQL can shine. It requires much use of repetition and the running grows exponentially. In fact, I wouldn't attempt it for N results where N > 3, N being the number of rows whose sum matches the expected result.

However you do it, I wish you good luck. I don't know what I'm saying, so do not assume it to be credible advice. I just came to say hello.
DanielTheGeek, dhtml18, Jregz, seunthomas, FincoApps, cbrass, FrankLampard, godofbrowser, thewebcraft, Javanian, booyakasha, larisoft, stack1, yawatide, tr3y, Knownpal, rayval, blueyedgeek, jidez007, KvnqPrezo, Jenifa123, VenantCode, directonpc, DavidTheGeek, crotonite, Blenyo11, CodeNister, CodeHouse, logicalhumour, Asalimpo, lekropasky...
Someone needs help.

Disclaimer: the mentioned monikers were semi-automatically generated.
Merry Christmas and a Happy New Year to all devs and techies.

[1] http://stackoverflow.com/questions/21020619/sql-server-select-rows-whos-sum-matches-a-value

[2] http://stackoverflow.com/questions/6289314/how-to-get-rows-having-sum-equal-to-given-value
Too much grammar, thanks for the links though, seems the problem is not a small one after all
ProgrammingRe: Select All Rows Where The Sum Of Column Equals A Value by BobAxelrod(op): 8:26pm On Dec 25, 2016
imustsaymymindo:
Did I try?

Select Rand(col1) from table_name where sum (col2) is Not Null
Nah this isn't what I'm looking for
ProgrammingRe: Select All Rows Where The Sum Of Column Equals A Value by BobAxelrod(op): 1:13pm On Dec 25, 2016
godofbrowser:
Oh! if i get you clearly, you need rows where after summing their col2 values you get 17?

Example: col2: 7+9+1 = 17 hence you get rows 3,4, and 5 ?
yes, do you know how I can achieve that
ProgrammingRe: Select All Rows Where The Sum Of Column Equals A Value by BobAxelrod(op): 10:23am On Dec 25, 2016
Noblecx:
OK, if I should get you clearly, you need to get all rows whereby the sum of col1 and col2 = 5?
Even can the sum be greater than 5?
No, it shouldn't be greater than, if 5 is not available then the database shouldn't return any result
ProgrammingRe: Select All Rows Where The Sum Of Column Equals A Value by BobAxelrod(op): 9:49pm On Dec 24, 2016
Noblecx:
Explain better, maybe with another illustration
The table has just two columns col 1 and col 2

Col 1 is the ID, and col 2 is the amount

Let's say I need to select all rows where the sum equals 5 .
It should return row 1 and 2 coz the values there are 2 and 3 i.e 2+3 =5

How do I go about it
ProgrammingRe: Select All Rows Where The Sum Of Column Equals A Value by BobAxelrod(op): 9:45pm On Dec 24, 2016
aubventure:
Which language are you working on
It's database, I'm using mssql
ProgrammingSelect All Rows Where The Sum Of Column Equals A Value by BobAxelrod(op): 5:07pm On Dec 24, 2016
I have a simple table:

col1 col2
1 2
2 3
3 7
4 1
5 9


I want to select random rows of (col1) where the cumulative sum of column (col2) equals a value

example:
select all random rows of col1 where the sum of col2 equals 17
returning: col1: 3, 4 and 5


Any ideas?

@dhtml and everyone

1 (of 1 pages)