我有一张桌子,名字:员工。表结构(的)如下:
CREATE TABLE "EMPLOYEES"
( "EMP_ID" NUMBER(6,0),
"FIRST_NAME" VARCHAR2(20),
"LAST_NAME" VARCHAR2(25) CONSTRAINT "EMP_LAST_NAME_NN" NOT NULL ENABLE,
"EMAIL" VARCHAR2(25) CONSTRAINT "EMP_EMAIL_NN" NOT NULL ENABLE,
"HIRE_DATE" DATE CONSTRAINT "EMP_HIRE_DATE_NN" NOT NULL ENABLE,
"JOB_ID" VARCHAR2(10) CONSTRAINT "EMP_JOB_NN" NOT NULL ENABLE,
"SALARY" NUMBER(8,2),
"COMMI_PCT" NUMBER(2,2),
"MANAGER_ID" NUMBER(6,0),
"DEP_ID" NUMBER(4,0),
CONSTRAINT "EMP_SALARY_MIN" CHECK (salary > 0) ENABLE,
CONSTRAINT "EMP_EMAIL_UK" UNIQUE ("EMAIL") ENABLE,
CONSTRAINT "EMP_EMP_ID_PK" PRIMARY KEY ("EMP_ID") ENABLE,
CONSTRAINT "EMP_DEPT_FK" FOREIGN KEY ("DEP_ID")
REFERENCES "DEPARTMENTS" ("DEPARTMENT_ID") ENABLE,
CONSTRAINT "EMP_JOB_FK" FOREIGN KEY ("JOB_ID")
REFERENCES "JOBS" ("JOB_ID") ENABLE,
CONSTRAINT "EMP_MANAGER_FK" FOREIGN KEY ("MANAGER_ID")
REFERENCES "EMPLOYEES" ("EMP_ID") ENABLE
)
我想显示那些包含元音对的员工姓名。
我只是尝试一下:
SELECT EMP_ID,JOB_ID,last_name
FROM employees
WHERE REGEXP_LIKE (last_name, '([aeiou])\1');