- Sep 19, 2000
- 10,284
- 138
- 106
Here is the setup, I'm transferring data from one table to another (Oh the fun!) One of the columns in the new table depend on the data in some of the other columns. So here is (essentially) what I'm trying to do.
Obviously this is incorrect syntax. Is it possible to do something like this without having a huge if statement that forces me to essentially duplicate the code except for a 0 or 1 in Column Cs place? (Hope that makes sense)
Code:
insert into tableA (ColumnA, ColumnB, ColumnC)
Select ColumnD, ColumnE, (ColumnD > ColumnE) from tableB;
Obviously this is incorrect syntax. Is it possible to do something like this without having a huge if statement that forces me to essentially duplicate the code except for a 0 or 1 in Column Cs place? (Hope that makes sense)