Tag Info

New answers tagged

8

Microsoft exams (and preparation material) tends to be stupid in some cases. It works best with excluding answers. You have to keep records? So truncate is not an option for you (and creating a new table is typically not the right way to solve it). Delete does free up the space. Of course not the harddisk space but (again typically) the space inside the ...


2

Not sure of the exact syntax for SQL Server (there's an edit that says that your RDBMS is SQL Server), but I'd do something like this (I'm making the assumption that a TRANSACTION is a - single - command :-). I don't think it's possible in a single line command. (pseudocode) BEGIN TRANSACTION; CREATE TABLE dummy AS SELECT * FROM My_Original_Table WHERE ...


0

If you want to DELETE all the information in table1.*: DELETE table1.* FROM test.table1 JOIN test.table2 ON (table2.id = table1.id) WHERE table1.price < (table2.price*2); This will DELETE all rows from table1 that match with the WHERE criteria. If you want to DELETE all the rows that match against the WHERE criteria in table2, just replace DELETE ...



Top 50 recent answers are included