Re: Help with complex SQL
Date: Wed, 04 Sep 2002 13:41:42 GMT
Message-ID: <q4od9.356744$UU1.60189_at_sccrnsc03>
As far as I can see you will have to write a function that takes two arguments. The date and the string. Then in the function parse out the string into dates and compare them to the date that was supplied. Return a 0 if greater and a 1 if not.
select * from yourTable where myFunction(maturity_date,schedule)=1;
It will force a full table scan, but not much one can do with a demoralized
database design. (schedule should be a separate table)
Jim
"Naeem" <naeem.saleem_at_mandg.co.uk> wrote in message
news:f223e72a.0209040321.67707d05_at_posting.google.com...
> Hi all,
>
>
> Have the following two column in a table:-
>
> Maturity_date Schedule
> 01-DEC-2002 {01-JAN-2002 10,01-FEB-2002 20,01-JAN-2003 30}
>
> A date List of Dates and amounts with comma seperator.
>
> If any of the dates in the Schedule column are greater then the
> Maturity_date then I want to ignore them ... i.e. 01-JAN-2003 30 in
> the above example.......
>
> What is the easiest way of achieving this in SQL?
>
> Many thanks in advance.
Received on Wed Sep 04 2002 - 15:41:42 CEST