There are 2 tables isp_cdr and lcr.
lcr (user_rate , digits)
isp_cdr (destination_number , billsec, nibble_total_billed)
The condition is check the destination_number which matches with the digits and uses the user_rate * billsec then updates nibble_total_billed .
The billing DB schema I have to put up with does things like that. They prefix with "r" (I can only assume that's short for referential) when a column is a join to a PK. I hate it personally, makes it harder to code for
@ypercubeᵀᴹ Recently I had occasion to work on a system where they had largely enforced unique column names. It made it ever so easy to grep for references in the sprocs. 10/10 would do this on my next project.
Another option would be to create all the prefixes of the selected word and test them with equality =, (or ILIKE*), against the strings in the table:
select t.prefix
from
(select 'aaaabbbbccccdddd'::text as word) as w,
generate_series(0, length(w.word)) as g,
lateral
(select t.prefix ...
nice try - I'd be happy to see some performance comparisons
i thought if we restrict to 12 digits through database , than no need to do any validation in php form to restrict for 12 digits ? i thought like that.... thanks.....
12 is stored somewhere in metadata for an application to use it if it needs it (for instance to determine the width of the output field on the screen or in a report or something).
The following piece of code is returning 1900-01-01 when the DOB field is null. I wanted (and expected) it to return an empty string ('') but it's not. How should I proceed to get my desired results?
isnull(convert(date,DOB,1),'')