DeveloperSide.NET Forums
August 04, 2020, 04:35:50 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: MySQL Syntax  (Read 13095 times)
0 Members and 1 Guest are viewing this topic.
rowlandk
Member
*
Posts: 9

7367666 rowland5@chartermi.net rowlandk83
View Profile WWW
« on: April 29, 2004, 08:04:11 PM »

Hello, I am having problems, with the syntax for a query and I thought someone could help.

I have mysql 4.0.18 installed and working correctly.

I am trying to use the following query

SELECT user_id, username
FROM table1
WHERE user_id = (SELECT MAX(user_id) FROM table1);

I have no idea why this does not work and as far as I can tell, it follows the syntax listed in the mysql manuals for subqueries.

Any suggestions?

Thanks
Logged

HP, Apache, and MySQL newb
Anonymous
Guest
« Reply #1 on: April 29, 2004, 08:24:29 PM »

did you...

use database-name-that-the-table-is-in;

..before all that.
Logged
rowlandk
Member
*
Posts: 9

7367666 rowland5@chartermi.net rowlandk83
View Profile WWW
Yep
« Reply #2 on: April 29, 2004, 08:38:29 PM »

I know all the connection and database info is correct.  It says I have an error in my syntax.

It is only when I attempt to use subqueries.

arg.....
Logged

HP, Apache, and MySQL newb
rowlandk
Member
*
Posts: 9

7367666 rowland5@chartermi.net rowlandk83
View Profile WWW
« Reply #3 on: April 30, 2004, 06:31:20 PM »

In case anyone was wondering,   4.0.18 does not support subqueries, and that is why my earlier query wouldn't work.  


The manual needs to be more specific. =(
Logged

HP, Apache, and MySQL newb
Anonymous
Guest
« Reply #4 on: May 01, 2004, 03:20:44 AM »

Was not wondering, but definitely good to know.

Is it just for the 4.1 branch?
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!