1

Topic: Ltrim in a cycle

All greetings. Prompt please as it is possible to erase quickly all gaps at all table
There is a table guest, in it a column comment, in it it is necessary to erase leading blanks

SELECT *, LTRIM (comment) FROM guest
where comment like ' % OF %'

The given request I receive an array, and here is how these values without a gap again to write down in a DB? At each line unique id.
I in SQL am not strong, on mind comes to create only the table new, there all to interpose, erase in existing and reversely to interpose from the temporary table. Can eat easier a variant?

2

Re: Ltrim in a cycle

lex871 wrote:

All greetings. Prompt please as it is possible to erase quickly all gaps at all table
There is a table guest, in it a column comment, in it it is necessary to erase leading blanks

SELECT *, LTRIM (comment) FROM guest
where comment like ' % OF %'

The given request I receive an array, and here is how these values without a gap again to write down in a DB? At each line unique id.
I in SQL am not strong, on mind comes to create only the table new, there all to interpose, erase in existing and reversely to interpose from the temporary table. Can eat easier a variant?

Is

update guest set comment = LTRIM (comment)

3

Re: Ltrim in a cycle

lex871,

update guest set comment=ltrim (comment) where comment like ' % OF %'

4

Re: Ltrim in a cycle

vikkiv;
And what for the first percent?

5

Re: Ltrim in a cycle

The visitor;
Because at  so in request
Another matter can what be interpreted somehow, in all table - that separately comment, all gaps, suddenly only ltrim.

6

Re: Ltrim in a cycle

Thanks big for answers. All turned out. With percent - yes, correctly noticed. I  by inertia write them. But at me gaps only on boundaries comment, therefore here it is not terrible.
You super!