User 22c88daf92
04-02-2013 03:53:19
hello!
We search the column "cd_sortable_formula" of the strcuture table by sql sentence "like 'C0%H0%",
We hope the results such as"C00001H00001" will be showed, but we find that some inapposite result also be find, such as "C00001Rh00001",
We want to know how to get the right result of the above problem, Is there any examples in Java?
thanks!
ChemAxon 61b4fee994
04-02-2013 09:23:23
Hello!
In the example the second example won't match if you don't use the upper function while selecting cd_sortable_formula. If you use Oracle database, there is a more distinguished function called REGEXP_LIKE.
I wrote an example for your query with this function:
select CD_SORTABLE_FORMULA from <tablename>
where regexp_like(CD_SORTABLE_FORMULA,'.*C[0-9]+.*H[0-9]+.*','c');
Regards,
Tamas