Subject Hello,
Author (no author)
Message-ID: <cmfmfl+jgbu@...>
User-Agent: eGroups-EW/0.82
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Length: 748
X-Mailer: Yahoo Groups Message Poster
X-Originating-IP: 212.59.23.83
X-Yahoo-Newman-Property: groups-compose
X-Yahoo-GPoster: 1h_dd5AJL1D65SJW

Hello,

I have Table1 and Table2. Table1.FieldA is integer and Table2.FieldB is
integer and can be NULL (in my case "Table2" is left joined 2 tables and
FieldB is right table field).

I am selecting FieldA from Table1 but if Table2.FieldB is not null then I
want to get Table2.FieldB value.

Example:
Table1
---------------
ID FieldA
---------------
0 2
1 5
2 6
3 7
4 9

Table2
---------------
ID FieldB
---------------
0 Null
1 8
2 Null
3 1
4 Null

Result should be:
---------------
ID FieldA
---------------
0 2
1 8 <- this came from FieldB
2 6
3 1 <- this came from FieldB
4 9

I want to do somthing like this (Pascal way :) ):
Select
ID,
IF
(Select FieldB from Table2 where Table2.FieldB = Table1.FieldA) is NULL
THEN
FieldA
From
Table1