Adrian Sue wrote:
> I want something like:
> WHERE customer.name LIKE '%customer.nickname%'
> (finding customer's whose nicknames are short versions of their real names, for example)
> I am also using MS Access, if that might introduce notational diferences....
Don't know about MS Access, but in "pure" SQL you can do the following (but don't expect
stellar performance on large tables):
USE test;
DROP TABLE IF EXISTS foo;
CREATE TABLE foo (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100),
nick VARCHAR(100)
);
INSERT INTO foo (name, nick) VALUES
('Johnaton', 'John'),
('Richard', 'Dick'),
('Peter', 'Pete');
SELECT
id, name, nick
FROM foo
WHERE
name LIKE CONCAT('%', nick, '%');
--
felix
Please use
BBCode to format your messages in this forum.