I have the following table:
CREATE TABLE DEPENDENTE
(
IdDependente number(6),
Matricula number(6),
Nome char(50) NOT NULL,
dtNascimento date,
constraint pk_IdDependente PRIMARY KEY(IdDependente),
constraint fk_DEPENDENTE foreign key(Matricula) references FUNCIONARIO(Matricula)
);
With INSERTS:
INSERT INTO DEPENDENTE VALUES(1, 1010, 'Francisca', to_date('01/03/1978', 'dd/mm/yyyy'));
INSERT INTO DEPENDENTE VALUES(2, 2935, 'Joana', to_date('10/08/1984','dd/mm/yyyy'));
INSERT INTO DEPENDENTE VALUES(3, 6987, 'Hugo', to_date('01/09/2009','dd/mm/yyyy'));
INSERT INTO DEPENDENTE VALUES(4, 6987, 'Turine', to_date('10/06/2003','dd/mm/yyyy'));
INSERT INTO DEPENDENTE VALUES(5, 1234, 'Augusto', to_date('30/06/2005','dd/mm/yyyy'));
And with the following SELECT:
SELECT 'O dependente ' || InitCap(Nome) || ' é dependente do funcionário de código: ', Matricula FROM Dependente WHERE Nome LIKE ('T%') OR ('A%');
I want to select only the dependents that have the letters T or A at the beginning of the name, but when using this SELECT above, it does not return what I want. It returns nothing. How can I correctly use the OR operator with LIKE ?