List:General Discussion« Previous MessageNext Message »
From:Ananda Kumar Date:August 20 2009 2:15pm
Subject:alternate in mysql
View as plain text  
Hi All,
I have this data in both oracle and mysql.

select * from tmp;
T
--------------------------------------------------
asdf
/sr/db/ora/ora.ora
asdfljk
asdlkjf

asdf
/sr/db/ora/ora.ora
/sr/db/ora/aaa.ora
asdlkjf
Where t is a varchar column, with each row having multiple lines.
I can write this query in oracle to fetch only rows starting with ''sr/db"

select substr(t, instr(t, '/sr/db/'), instr(substr(t, instr(t, '/sr/db/'),
length(t)), chr(10))) from tmp;
/sr/db/ora/ora.ora
/sr/db/ora/ora.ora
where chr(10) ..represents "NEW LINE" in oracle

How do i do the same in mysql.

Thanks for all you help.

regards
anandkl

Thread
alternate in mysqlAnanda Kumar20 Aug
  • Re: alternate in mysqlJohnny Withers20 Aug
    • Re: alternate in mysqlAnanda Kumar21 Aug
      • RE: alternate in mysqlJerry Schwartz21 Aug
        • Re: alternate in mysqlJohnny Withers21 Aug
          • Re: alternate in mysqlAnanda Kumar7 Sep