Jump to content

[SOLVED] once, twice, ...


0x00

Recommended Posts

for this test i create a table with:

$s = "CREATE TABLE test_math (x int not null, y int not null )";

then add some data, say:

$s = "INSERT INTO test_math VALUES (2, 1), (2, , (2, 3), (2, 5), (2, 7), (2, 4), (2, 6), (2, 2) ";

 

heres my first query...

$s = "SELECT x, y, POW(x,y) as z FROM test_math WHERE (POW(x,y) > 16) ORDER BY POW(x,y)";

i can refine it like this...

$s = "SELECT x, y, POW(x,y) as z FROM test_math WHERE (POW(x,y) > 16) ORDER BY z";

 

but is there a way to just do the math once?

 

say like this (no it doesnt work!)

$s = "SELECT x, y, POW(x,y) as z FROM test_math WHERE (z > 16) ORDER BY z";

Link to comment
https://forums.phpfreaks.com/topic/108282-solved-once-twice/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.