Prashobh
Prashobh

Reputation: 9542

How to select values in oracle10g database?

For example my table contains a column 'skills'. oracle table

i want to search the name who having skills in java and oracle. I know its very simple,i am very new to oracle10g,please help me. i tried like

select name from table_name where skills='java' or skills='java';

the name 'c' having skills in java and html,how can i select ?

select name from table_name where skills='java,html';

i dont know which method i wanna use,please help me.

Upvotes: 1

Views: 195

Answers (3)

Dummy01
Dummy01

Reputation: 1995

This will return any name that has java in its skills list.

select name from table_name where ','||skills||',' like '%,java,%'

Upvotes: 2

P B
P B

Reputation: 67

as shown in your table if you want to select names whose skills are either java or oracle you can do select name from table_name where skills like '%java%' or skills like '%oracle%' this will select all the names whose skills contains java or oracle

Upvotes: 1

Pablo
Pablo

Reputation: 3673

select name from table_name where skills like '%java%' or skills like '%oracle%';

That will give you names who have skills in java or oracle. If you want names that have both at the same time, change the "or" for "and".

Upvotes: 1

Related Questions