Search Postgresql Archives

Re: date range query help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



novice wrote:
2008/11/20 Adam Rich <adam.r@xxxxxxxxxxxxx>:

select call.call_id,
 call.datetime,
 mobile_custodian.user_id,
 call.mobile_no
 call.charge
from call, mobile_custodian
where call.mobile_no = mobile_custodian.mobile_no
and call.datetime between mobile_custodian.issue_date
       and mobile_custodian.return_date

sorry I get nothing :(


How about:

SELECT call.call_id,
call.datetime,
mobile_custodian.user_id,
call.mobile_no,
call.charge
FROM call
LEFT JOIN mobile_custodian
ON call.mobile_no = mobile_custodian.mobile_no
AND call.datetime
  BETWEEN
  mobile_custodian.issue_date
  AND
  mobile_custodian.return_date;

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux