Page 1 of 1

mssql subselect to mysql

Posted: Tue May 20, 2003 4:51 am
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...

Posted: Tue May 20, 2003 7:04 am
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!