• Post Reply Bookmark Topic Watch Topic
  • New Topic

SQL Script to delete the records based on length

 
sudha swami
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am looking for the SQL Script to delete the name whose length is less than 4 characters.

regards
sudha
 
Jan Cumps
Bartender
Posts: 2619
14
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mysql example (be carefull when testing!)
Regards, Jan
 
sudha swami
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using database as Oracle.
regards
sudha
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 35977
422
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sudha,
That SQL will work in Oracle too.
 
Paul Campbell
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sudha,

Do you want to update the name to be null (remove it) where it is less than 4 or do you want to delete the row where the name is less than 4?
 
Jan Cumps
Bartender
Posts: 2619
14
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I derived from the post's title that it was a request to delete them.
Regards, Jan
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!