Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

[oracle] problem with -long raw-

Status
Not open for further replies.

ElvisUntot

Programmer
Jan 8, 2002
72
DE
i got 2 tables.

table 1 consists of an index, a boolean field and a long raw field

table 2 has just a long row field (with only one entry)


now i need a result with everything in table 1. but the long raw from table 1 schould be replaced with the data from table
2 if the boolean field contains 'false' or the long raw field is NULL.

 
Does this work for you?

Select *
From table1
Where BoolCol=1 And RawData Is Not Null

Union

Select t1.IndexCol, t1.BoolCol, t2.RawData
From table1 As t1, table2 As t2
Where t1.BoolCol=0 Or t1.RawData Is Null
Terry L. Broadbent - DBA
SQL Server Page:
If you want to get the best answer for your question read faq183-874.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top