Thread: Select
Hello all, How can I select from a table all the tupples with a specific word? Ex.: I have a table like this: 1 | 'Jose' Carlos Santos 2 | Maria 'Jose' Pinheiro 3 | Joaquim 'Jose' Castro 4 | Marcelo Pereira Sa 5 | Chuck Hagen 6 | John 'Jose' Pinto I would like to select all the tupples with the work 'Jose'. So, the tupples: 1,2,3 and 6. Thanks in advance, [ ]'s Marcelo Pereira -- Remember that only God and Esc+:w saves. __ (_.\ Marcelo Pereira | / / ___ | / (_/ _ \__ Matematica/99 - IMECC | _______\____/_\___)___Unicamp_______________/
See: http://www.postgresql.org/idocs/index.php?functions-matching.html In your case SELECT * FROM xxx WHERE name LIKE '%Jose%'; Lee. Marcelo Pereira writes: > How can I select from a table all the tupples with a specific word? > > Ex.: I have a table like this: > > 1 | 'Jose' Carlos Santos > 2 | Maria 'Jose' Pinheiro > 3 | Joaquim 'Jose' Castro > 4 | Marcelo Pereira Sa > 5 | Chuck Hagen > 6 | John 'Jose' Pinto > > I would like to select all the tupples with the work 'Jose'. So, the > tupples: 1,2,3 and 6.
tor, 2002-01-24 kl. 14:34 skrev Marcelo Pereira: > I would like to select all the tupples with the work 'Jose'. So, the > tupples: 1,2,3 and 6. How about : SELECT id,name FROM name_table WHERE name LIKE '%Jose%' Btw. I really think this question belongs to the "Novice" mail list. /BL