Home » SQL & PL/SQL » SQL & PL/SQL » How to delete
How to delete [message #197689] Thu, 12 October 2006 05:51 Go to next message
arunprabhu29917
Messages: 15
Registered: September 2006
Location: Tamilnadu
Junior Member

EMPNO EMPNAME EMPID EMPADD
---------- -------------------- -------------------- --------------------
100 arun u100 udt
101 prabhu u101 poy
102 raj u102 trichy
103 devi u103 covai
104 nimmy u104 palani
105 sam u105 trivandrum
105 sam



In above table I want to delete the last row..i.e empno 105,empname sam.


how to do it?

[Updated on: Thu, 12 October 2006 05:52]

Report message to a moderator

Re: How to delete [message #197690 is a reply to message #197689] Thu, 12 October 2006 05:54 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
use where... is null on the empty columns.
Re: How to delete [message #197692 is a reply to message #197690] Thu, 12 October 2006 06:00 Go to previous messageGo to next message
arunprabhu29917
Messages: 15
Registered: September 2006
Location: Tamilnadu
Junior Member

what is the query?
Re: How to delete [message #197694 is a reply to message #197692] Thu, 12 October 2006 06:03 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Try. Give it a shot. What do YOU think the query should look like?
Re: How to delete [message #197695 is a reply to message #197689] Thu, 12 October 2006 06:13 Go to previous messageGo to next message
arunprabhu29917
Messages: 15
Registered: September 2006
Location: Tamilnadu
Junior Member

SQL> DELETE FROM arun
2 WHERE
3 empadd=NULL;

0 rows deleted.

[Updated on: Thu, 12 October 2006 06:23]

Report message to a moderator

Re: How to delete [message #197697 is a reply to message #197695] Thu, 12 October 2006 06:24 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
read up in the documentation on NULLs. You cannot compare something to NULL using "=", you have to use "is"
Re: How to delete [message #197887 is a reply to message #197697] Fri, 13 October 2006 02:09 Go to previous message
be2sp1
Messages: 52
Registered: September 2005
Location: India
Member
DELETE FROM arun
2 WHERE
3 empadd is NULL;

Suggest, try doing some hit n trial and searching (internet, documentation etc) to find a way.

Thanks
Previous Topic: ORA-01843: not a valid month -Error
Next Topic: Calculating running percentage discount
Goto Forum:
  


Current Time: Fri Dec 09 06:16:22 CST 2016

Total time taken to generate the page: 0.05426 seconds