Reputation: 11
im writing a program which finds the differences between a list of names(the values are in a temp table) and a databank column.
I was thinking about using the IF clauses. Like IF tmp_names.name = names.name THEN Display „Nothing“ ELSE Insert into tmp_new_names.names. but I didnt find a way to use it with a column (I think it only works when you compare two variables). So i need to extract the names which are in my Databank Column but arent in my List. These Names need to be extracted into another Databank Column. I’m using informix sql and genero 4gl.
Upvotes: 0
Views: 146
Reputation: 326
I wondered if you were not aware of the SQL IN clause
SELECT name
FROM table A
WHERE A.name NOT IN (SELECT name FROM table B)
So let the database do the work, not the 4gl
Upvotes: 0
Reputation: 3
if - else is just "where" clause in sql,check up on that also for column of two table you can just check like .column=.cloumn
Upvotes: 0