General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Without setting up similar tables and testing it, this would be my first guess:
select customer.name,sum(summary.total)
from customer,summary
where customer.cust_id = summary.cust_id
and summary.inv_num = detail.inv_num
and customer.bill_st = "GA"
and summary.shp_date >= (date() - 365)
and summary.inv_num not in
(select detail.inv_num from detail where substr(detail.inv_id,1,2)="SE")
group by customer.name
having sum(summary.total) > 1000
My apologies for wasting your time if it doesn't work or at least get you close.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only