Reputation: 15
I want to remove those blank spaces and is there any way to add data in the same row if it is null instead of adding in the next row
Upvotes: 1
Views: 1160
Reputation: 596
Make use of the following query according to your table name and column name in order to remove the blank entries in your database.
DELETE FROM "table name" WHERE "column name" IS NULL;
and make use of the following query in order to update the already existing row
UPDATE "table name" SET "column name" = "any thing" WHERE "condition";
Upvotes: 0
Reputation: 790
Hi you can use TRIM() function and replace() for /r/n
select replace(replace(trim(coloum_name),'/r',''),'/n','') from table;
and yes you can replace null with
select coalesce(coloum_with_null,'any_value') from table;
Upvotes: 1
Reputation: 659
You can use Trim() function.
Example 1
INSERT INTO table_name (column1,column2,column3,...)
VALUES (TRIM(' value1 '),TRIM(' value2 '),TRIM(' value3 '),...);
Result:
'value1'....
Upvotes: 0