query (sub) select
| From: | OpenSource | Date: | Fri, 20 Jun 2003 21:47:59 +0000 |
| Subject: | query (sub) select | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-28775@lists.php.net to get a copy of this message | ||
Hey guys,
I was wondering if this code is possible. I say it is a 4GL code that I am migrating to PHP.
+++++++++++++++++++++++++++++++++++++++++++
$side1Query=ifx_query('select * from line, event'
.' where line.e_id=event.e_id '
.' and l_type="'.$s_lt.'" '
.' and l_status in ("O","C") '
.' and u_type="P" '
.' and betno in
(select min(betno) from line, event
where line.e_id=event.e_id
and l_type="'.$s_lt.'") ',$db) or die (ifx_error());
+++++++++++++++++++++++++++++++++++++++++++
I am asking because it would greatly help me since my current method is to select the (min) then use
the min in the query.
+++++++++++++++++++++++++++++++++++++++++++
$minS_LT = ifx_query('select min(betno) from line, event'
.' where line.e_id="'.$ecols['e_id'].'" '
.' and line.l_status in ("O","C") '
.' and line.u_type="P" '
.' and l_type="'.$s_lt.'" ',$db) or die (ifx_error());
$betcols1=ifx_fetch_row($minS_LT);
$min_betno1=min($betcols1);
+++++++++++++++++++++++++++++++++++++++++++
$side1Query=ifx_query('select * from line, event'
.' where line.e_id=event.e_id '
.' and l_type="'.$s_lt.'" '
.' and l_status in ("O","C") '
.' and u_type="P" '
.' and betno="'.$min_betno1.'"',$db) or die (ifx_error());
+++++++++++++++++++++++++++++++++++++++++++
Thanks in advance for your assistance.
Regards,
RedHat
http://redhat.opensource.bz
redhat@opensource.bz