Page 1 of 1

wHATS wrong with max function

Posted: Tue Sep 28, 2004 7:06 pm
by winsonlee
I tried using the following sql statement to get the maximum value from the record. But it doesnt seems to be working.

Code: Select all

$sql= " select MAX(loan_id) from loans";

	$statement = OCIParse($connection, $sql) or die("error in sql statement<br>");
	OCIExecute($statement) or die("error executing sql statement<br>");

		echo OCIResult($statement, 'loan_id');

	OCICommit ($connection);
	OCILogoff($connection);

Posted: Tue Sep 28, 2004 11:25 pm
by feyd
you're asking for the wrong column name, I think.. the column name would be 'MAX(loan_id)' I believe..