- Make sure that there are no duplicates!!!
select distinct tc.COMPANY_ID, tc.NAME from TAB_TACC_RECHNUNGEN tr, tab_tacc_company tc where tr.COMPANY_ID = tc.COMPANY_ID and UPPER(tc.NAME) like UPPER('%scc%') group by tc.COMPANY_ID, tc.NAME order by tc.NAMEtab_tacc_technungen is needed because we need only companies with invoices - but why join and not exist?
Why distinct and group by?
tc.company_id is PK of tab_tacc_company - so after elimination of 'join', distinct is not needed any more.
wtorek, 19 lipca 2011
poniedziałek, 18 lipca 2011
piątek, 15 lipca 2011
List to String in Python
- Using build in __str__ and str.strip
if isinstance(tour_id, list):
tour_id_str = str(tour_id).strip("[]")
The fact is that tour_id contains only ints so 'casting' to string have to be done befor using str.join
Using for loop
tmpCompanyListStr = ""
for tmpCompany in cid:
tmpCompanyListStr += "%s, " %(tmpCompany)
tmpCompanyListStr = tmpCompanyListStr.rstrip(', ')
It is hard to say if author had knowlage about str.join but he was using str.rstrip.
Subskrybuj:
Posty (Atom)