Is it possible to delete the values in single a row without using DELETE keyword....If so whats the Query
Question asked by visitor P.PRAVEEN KUMAR
Is it possible to delete the values in single a row without using DELETE keyword....If so whats the Query
Question asked by visitor P.PRAVEEN KUMAR
update 'tablename' set value=null where 'any unique id'
I thought by this we can delete values....
I don't understand the term "delete the values in single a row"...
give us an example
hello every one
i'm new here i want to become an active part of Geeks Talk but i don't know how so i try with sql i find it so hard iwant learn may be my language is not that good to yndeastand the select andd insert statements i don't know why ?
wuld any one can help make me professional in the sql
u can update the fields by null but it will create another problem. the data is removed but the row is still there (a row of null records).
hello,
well yeah the update will change the values to null a sort of delete but when u ll view the table still that row exists so that does not implies that anything got deleted. still a good attempt
If we are not going to use Delete we could just reset the values to Null or Missing. If we wanted to delete the entire ROW than we would have to be a bit more clever.
In this case, something like this should work:
UPDATE myTable Set field1 = "", field2 = "", field3 = "" where ROWID = 123;
I hope this is what you were looking for.
Though what many of you have suggested i.e. to update the values to NULL sounds fine, but the problem will arise while updating the primary key column value, since a NULL value in that case isn't allowed.
What say !!!
[QUOTE=Geek_Guest;13761]Is it possible to delete the values in single a row without using DELETE keyword....If so whats the Query
Question asked by visitor P.PRAVEEN KUMAR[/QUOTE
as per my knowledge it is not possible.u can updatae values by using the update command.
I thought the question mentioning about values not deleting row or any other thing... So, I hope it may be good one...
Creating a table, and inserting everything except that row.
Generally in data warehousing (some tools are not good with delete statement, like teradata). At that in case you have to delete or update huge part of the table, this is better scenerio to do it.
I hope this helped.
Cheers,
Shilpa.
Hi Shilpha,
Good. But, I have one doubt can you clear it. If previous table was refered by some other tables means what will happen. If any wrong, How can we rectify that.
eg :
As per your thought,
old table
Student(Rollno,Name,Address)
new table
StudentDetails(Rollno,Name,Address)
See here other tables refering 'Student' table
1. Marks
2. Sports
I also want to know abt. it.
It is not possible bcoz if u updating table then data are deleted but still is remaining with null data & if u used Truncate then it delete records for premanently
Nice question mikerich135
According to me this technique will work well in case of data warehouse where u generally have no referencial integrity or soft referential integrity (where there is just a subtable maintained for errors and its never enforced).
But if in case we thought abt databases where referencial integrity is a big contraint then another approach can be adding a new column in table which maintains active/inactive.
Cheers,
Shilpa.
hi
these r the basic questions in sql.
for removing the rows there r two options..
delete is a dml command u can rollback the values
truncat is dml command u cant rollback the values
You can create another table with the same structure and insert the rows which are satisfying your conditions i.e. Leave all the rows which you want to delete.
E.g. Original table - A new table - B (structure same as a)
insert into b select * from a where
cheers! umesh
Last edited by manglani2004; 09-27-2007 at 12:23 AM. Reason: formatting