Question on joining tables

Поиск
Список
Период
Сортировка
От Chris Pizzo
Тема Question on joining tables
Дата
Msg-id 00a101c20b1e$d342f3e0$832aa8c0@itchrisp
обсуждение исходный текст
Ответы Re: Question on joining tables
Список pgsql-novice
Hi,
I have an interesting issue where i need to join two tables where the field that jions them is similar but not identical.  Table A field data is char(12) and contains data that looks like:
 
BBB12345
BBB345
BBB4980
BBB3455
 
Table B field data is char(32) and contains data that looks like:
 
MMM12345
BBB345
BBB4980
MMM3455
 
I need a way to equate  MMM12345 to BBB12345 in the join.  I tried using substrings but this fails ie.
 
select some_data from A,B where (substr(A.field,4,12) = substr(B.field,4,12));
 
anyone point me in the right direction?
 
Thanks,
Chris Pizzo

В списке pgsql-novice по дате отправления:

Предыдущее
От: "Nicolas Bazin"
Дата:
Сообщение: Re: [PORTS] ecpg not found
Следующее
От: Oliver Elphick
Дата:
Сообщение: Re: Incorrect date/time returned by current_timestamp