История изменений
Исправление
snoopcat,
(текущая версия)
:
есть таблица вида
id | code | direction
1 | 79 | Россия Прочее
2 | 796 | Россия Билайн
надо превратить «79601234567» в «2», функцию писал не я
Если только там не select * from table раз в полчаса.
пример запроса:
query = sql_query(«select users.*, accounts.balance, accounts.off_threshold, currencies.usd_course, round(currencies.usd_course::numeric*accounts.balance::numeric,3) as displaybalance, round(currencies.usd_course::numeric*accounts.off_threshold::numeric,3) as displayoffthreshold, currencies.displayname as displaycurrency, tariffications.name as tariffname from users inner join accounts on (users.account = accounts.account) inner join currencies on (currencies.currency = coalesce( (select currency from currencies where currency = '»..curr..«'), 'USD')) inner join tariffications on (tariffications.id = coalesce( (select id from tariffications where id=users.tariffications), 1)) where users.»..get_by.." = '"..username..«'»)
Исправление
snoopcat,
:
есть таблица вида
id | code | direction
1 | 79 | Россия Прочее
2 | 796 | Россия Билайн
надо превратить «79601234567» в «2», функцию писал не я
Если только там не select * from table раз в полчаса.
Если только там не select * from table раз в полчаса.
пример запроса:
query = sql_query(«select users.*, accounts.balance, accounts.off_threshold, currencies.usd_course, round(currencies.usd_course::numeric*accounts.balance::numeric,3) as displaybalance, round(currencies.usd_course::numeric*accounts.off_threshold::numeric,3) as displayoffthreshold, currencies.displayname as displaycurrency, tariffications.name as tariffname from users inner join accounts on (users.account = accounts.account) inner join currencies on (currencies.currency = coalesce( (select currency from currencies where currency = '»..curr..«'), 'USD')) inner join tariffications on (tariffications.id = coalesce( (select id from tariffications where id=users.tariffications), 1)) where users.»..get_by.." = '"..username..«'»)
Исходная версия
snoopcat,
:
есть таблица вида
id | code | direction
1 | 79 | Россия Прочее
2 | 796 | Россия Билайн
надо превратить «79601234567» в «2», функцию писал не я
Если только там не select * from table раз в полчаса.
пример запроса:
query = sql_query(«select users.*, accounts.balance, accounts.off_threshold, currencies.usd_course, round(currencies.usd_course::numeric*accounts.balance::numeric,3) as displaybalance, round(currencies.usd_course::numeric*accounts.off_threshold::numeric,3) as displayoffthreshold, currencies.displayname as displaycurrency, tariffications.name as tariffname from users inner join accounts on (users.account = accounts.account) inner join currencies on (currencies.currency = coalesce( (select currency from currencies where currency = '»..curr..«'), 'USD')) inner join tariffications on (tariffications.id = coalesce( (select id from tariffications where id=users.tariffications), 1)) where users.»..get_by.." = '"..username..«'»)