I have a table which contains three field ip_address,contary_name,region_name.
ip_address countary_name region_name
100.12.34.19 xyz jk
100.12.34.23 xyz jk
170.63.34.41 abc mn
170.63.34.42 abc mn
170.63.34.43 abc mn
so i need some query like this :
select distinct substring('rex_exp') as common_ip,
substring('rex_exp') as ip_part,countary_name,region_name
from table;
and output is
common_ip ip_part countary_name region_name
100.12.34. 19,23 xyz jk
170.63.34. 41,42,43 abc mn
ip_address
? Is that a varchar/text column or aninet
type? – a_horse_with_no_name Jun 21 '12 at 6:11