Need help with sql statement
Posted in 2000
Topics: General Discussion
The following sql returns no rows. Any idea why?
select file_rid from arc_file where file_name matches "*
(select unique ae_logid from arc_archive_event a, arc_request b where date(b.req_issue_date) = '1/24/00' and
b.req_type='AR' and b.req_status='SU' and
a.ae_rid=b.req_rid)
";
* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful
ay wrote in message <1b7059f0.ec0da356@usw-ex0110-076.remarq.com>...
>The following sql returns no rows. Any idea why?
>
>select file_rid from arc_file where file_name matches "*
>(select unique ae_logid from arc_archive_event a, arc_req>uest b where date(b.req_issue_date) = '1/24/00' and
>b.req_type='AR' and b.req_status='SU' and
>a.ae_rid=b.req_rid)
>";
>
It means, that the field arc_file.file_rid does not contain such value, as
"*(select unique ae_logid from arc_archive_event a, arc_request b
where date(b.req_issue_date) = '1/24/00' and b.req_type='AR' and
b.req_status='SU'
and a.ae_rid=b.req_rid)";
But generally, it is interesting idea - to store SELECT-statements in
database . :-)
Best regards,
Victor.
If the goal is to match "file_name" with results from the subquery,
the select statement should read:
select file_rid from arc_file where file_name in
(select unique ae_logid from arc_archive_event a, arc_request b
where date(b.req_issue_date) = '1/24/00' andb.req_type='AR' and b.req_status='SU' and
a.ae_rid=b.req_rid);