If you are asking for SQL, you can do something like this for table that already created:
INSERT INTO NEW_TABLE (col1,col2,...)
SELECT col1,col2,...
FROM YOUR_TABLE
EXCEPT SELECT ...
Or if you want to create a new table using that query without specifying each columns (copy the column specs from the source table), you can do something like this:
SELECT ...
INTO NEW_TABLE
FROM YOUR_TABLE
EXCEPT
SELECT ...
FROM ANOTHER_TABLE
If your new table want to drop after you have processed with your data, consider #temptable
or @tablevariable
.
But if you just want to do some processing in the resulting table but do not want to store it in database, I recommend using DataTable in .NET by doing something like this:
using System;
using System.Data;
//...
DataTable dttbl = new DataTable();
dttbl.TableName = "YOUR_TABLE";
dttbl.Load(new SqlCommand("SELECT ...",sqlConnection).ExecuteReader());
//process your datatable using indexing like this
dttbl.Rows[(row_number (int))][(column_name (string), column_position (int))] = "Processed";
dttbl.Rows[0]["col1"] = "Processed"; //This line will change the value in cell of the first record in column named "col1" to "Processed".
EDIT*: More about dataTable
To print out a whole DataTable
//Print out the columns name
for(int i=0;i<dttbl.Columns.Count;i++)
Console.Write(dttbl.Columns[i].ColumnName + " ");
Console.Write("\n");
//Print out the data
for(int i=0;i<dttbl.Rows.Count;i++)
{
for(int k=0;k<dttbl.Columns.Count;k++)
{
Console.Write(dttbl.Rows[i][k] + " ");
}
Console.Write("\n");
}
Note: SQL is database query language while C#,VB or other .NET language is programming language. In short, database query language is a way for programming language to communicate with database.