Postgres SELECT*FROM表WHERE column-varchar =="string-example"?

Jek*_*eka 3 postgresql postgresql-9.1 postgresql-9.3

我有下表:

CREATE TABLE lawyer (
  id SERIAL PRIMARY KEY,
  name VARCHAR NOT NULL UNIQUE,
  name_url VARCHAR check(translate(name_url, 'abcdefghijklmnopqrstuvwxyz-', '') = '') NOT NULL UNIQUE
);
Run Code Online (Sandbox Code Playgroud)

我想SELECT*FROM lawyer,其中name_url ="john-doe"

a_h*_*ame 18

字符文字放在单引号中:

SELECT * 
FROM lawyer 
where name_url = 'john-doe';
Run Code Online (Sandbox Code Playgroud)

有关详细信息,请参阅手册:https:
//www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-CONSTANTS