Afficher un message
Vieux 02/10/2007, 10h34   #3
Captain Paralytic
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: name and surname in a single field

On 1 Oct, 18:25, alessandro.sta...@gmail.com (Ale Stanga) wrote:
> Peter H. Coffin <hell...@ninehells.com> wrote:
>
> > "*" is not a LIKE wildcard. "%" and "_" are LIKE wildcards.

>
> my query is:
> rs.open "select artista, substring(artista, locate(artista, ' ') as
> surname , online from artisti where online = 'S' having surname like
> 'W%' order by surname asc" , conn
>
> but "Andy Warhold" is in the database in the ARTISTA field.
> where's the problem?
> thanks, Ale.


Wouldn't it be easier to say

SELECT
artista,
substring(artista, locate(artista, ' ') as surname,
online
FROM artisti
WHERE online = 'S' AND artista LIKE '% W%'
ORDER BY surname ASC

  Réponse avec citation
 
Page generated in 0,05841 seconds with 9 queries