-1

Possible Duplicate:
Need to write a SQL query to fetch data from a Oracle database

I need to write a SQL query which can fetch a data from one table A.

Senario - Lets take table A has only two column C1 and C2. C1 has row_id's and C2 has vaues like "Site=google;site=gmail;yahoo"

Requirment - Need to write a query which can fetch all the row_id from column C1 of table A but the value should come for column C2 as "yahoo". Means if anything starts with "Site=" in any value of C2 column then it should not been shown in the data fetch.

2
  • 2
    Exact duplicate of "stackoverflow.com/questions/5091642/…"? Commented Feb 23, 2011 at 14:21
  • @TToni: I just re-read this and thought to myself that my SO hadn't refreshed properly lol Commented Feb 23, 2011 at 14:25

1 Answer 1

0

Try

select
   *
from
   tableA
where 
   c2 not like 'site=%'
Sign up to request clarification or add additional context in comments.

5 Comments

I think you have misunderstood the question.
No Jon, I think you got this wrong. Example - Suppose if a value is "Site=google;site=gmail;yahoo" then query should fetch "yahoo" only.
Ah, I see - give me a minute...
I see there's an answer on the other copy of this question. I'll leave it there.
Jon that was different question..Here is different. If you can, then please answer it here. It would be great help.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.