Select based on substring

How to write the query and select all the ids which has the different values.

In table 1, value is ‘2010/07/12/abc’

and in table2 value is in the format ‘2010-07-12 00:00:00’.

How to do the match and check the value ‘2010,07,12’ are same.

select c.value from table1 c, table2 cv where c.id=cv.id

How to split the value and check if the values are matching. List only if the values are different

LEFT is a pretty basic string function – to understand how it works, i suggest you look it up in the manual

doesn’t match? but in post #1 you wanted them to match?

use <> instead of =

Can you please explain me how this works.

Actually i want to compare the values which is in two different format.

One is in ‘2010/03/12/abc’ and other is in ‘2010-03-12 00:00:00’

From the values ‘2010/03/12/abc’, and 2010-03-12 00:00:00 how to select the rows if the string doesnt match 2010 and 03 and 12 from the above example.

i

… WHERE LEFT(c.id.10) = LEFT(cv.id,10)

assuming they are CHAR or VARCHAR columns in the first place