projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d37e29d
)
quick query on desynced bill dates, RT#9733
author
ivan
<ivan>
Wed, 25 Aug 2010 23:15:30 +0000
(23:15 +0000)
committer
ivan
<ivan>
Wed, 25 Aug 2010 23:15:30 +0000
(23:15 +0000)
bin/select-cust-desync_bill_dates.sql
[new file with mode: 0644]
patch
|
blob
diff --git a/bin/select-cust-desync_bill_dates.sql
b/bin/select-cust-desync_bill_dates.sql
new file mode 100644
(file)
index 0000000..
5506f90
--- /dev/null
+++ b/
bin/select-cust-desync_bill_dates.sql
@@ -0,0
+1,9
@@
+SELECT DISTINCT custnum, agent_custid, first, last, company
+ FROM cust_pkg LEFT JOIN cust_main USING ( custnum )
+ WHERE cancel IS NULL AND 0 < (
+ SELECT COUNT(*) FROM cust_pkg AS others
+ WHERE cust_pkg.custnum = others.custnum
+ AND cust_pkg.pkgnum != others.pkgnum
+ AND cust_pkg.bill != others.bill
+ AND others.cancel IS NULL
+ );