Hello
Newbie to Prolog - never used it yet! - however, looks interesting.
I was wondering if Prolog can be used to solve my query below. I write many many queries in sql
and it would be great if I could select a known field and something like Prolog could throw out the tables and joins...
In the original table each order may have multiple invoice numbers - example .......
TABLE ORDERS
order_no order_seq inv_no
1234 1 I14567
1234 2 I23454
4567 1 A34567
7894 1 2348900
7894 2 4459888GH
7894...
Thanks for this - it works\ish - but when the issue.issue_id does not have a sequencial number then the next_row_date column returns incorrect date - below is an extract of the data returned from your script ........
oc_id issue_id issue_date next_row_date TblIss
124 5332 1/10/07 1/11/07...
There are two tables
one is called oc and the second table is called issue.
oc.oc_id issue.issue_id issue.issue_date "next_row_date"
10 1234 01\01\2006 10\01\2006
10 1235 10\01\2006 04\02\2006
10 1236 04\02\2006
25...
Thanks for the quick response - not sure how Tbl1 - Tbl2 works?
This would be my starting sql to retrieve the first three columns .....
select oc.oc_id, issue_id, issue_date, from oc
inner join issue on oc.oc_id = issue.oc_id
How does this work with your Tbl1 & Tbl2
Many thanks
Phil
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.