I know I can do something like this: select replace(postcode, rtrim(postcode, replace(postcode, ' ', '')), '') from addresses
which will get the part of the postcode starting with the space. Problem however is how to deal with the forward slash. RBS On Fri, Dec 6, 2019 at 11:09 PM Scott Robison <sc...@casaderobison.com> wrote: > On Fri, Dec 6, 2019, 4:00 PM Bart Smissaert <bart.smissa...@gmail.com> > wrote: > > > Have table with SQL statements and these statements may have comments, > > starting with /* > > How do I select the part of this statement starting with the last /* ? > > So if the statement is: > > select field1 /*comment 1 */ from table1 /*comment 2*/ > > I would like to get: > > /*comment 2*/ > > > Is there more format to the comment than just plain text? > > My senior project was a SQLite helper that would read a bunch of statements > from a sql script and create classes to automate the boilerplate code and > ensure they were prepareable. To accomplish this I needed some new syntax > that wouldn't interfere with SQLite, so I embedded it in comments, but they > had to conform to a simple structure so that I could find them via regex. > > Perhaps, if it is only the last comment you care about, you could use a > regex. I'm on a phone right now and don't want to try to type in valid > regex strings, but that would be useful I could help with it when I'm near > a real keyboard. > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users