mssql subselect to mysql

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
valen53
Forum Contributor
Posts: 137
Joined: Tue Aug 27, 2002 9:29 am

mssql subselect to mysql

Post by valen53 »

i need to change my DB from mssql to mysql now. i face a problem.

$dept_Fr = "Select depart_from from OT_login where emp_id ='$ecm'";
$dept_To = "Select depart_to from OT_login where emp_id ='$ecm'";

$query = "Select * from dw_emp where DEPT_ID >=($dept_Fr) and DEPT_ID <=($dept_To)";

this subselect was function for mssql but possible or not for mysql ? b'cos i can't select out any data when using mysql. any method can used for replace this subselect ?
thank a lot...
toantt
Forum Newbie
Posts: 6
Joined: Sat May 17, 2003 11:31 pm

Post by toantt »

MySQL Server currently only supports nested queries of the form INSERT ... SELECT ... and REPLACE ... SELECT ....

You can, however, use the function IN() in other contexts.

Subselects are currently being implemented in the 4.1 development tree above.

You have to check your mysql version please!
Post Reply