Skip to content

Tag: join

Replacing null based on a condition

I am having a table with many columns (but posting only col1, col2, col3 here for simplified post): I want to fill null values of source _id with values from id. For example, source_id a5 row has null which has to replaced with id a1 values, subsequently, source_id a6 row having null to be replaced with a5 ro…

Single column from Multiple columns from join in SQL

I have a table output like this, which is a result of multiple table joins. I am trying to get a table like this. This is what i am doing currently doing. Not sure how to make the three columns combine to a single column. Answer If you have only one value per row — or if you just want

Join Multiple Table based on a condition

I have data where i need to join to different tables based on a condition, month. I am using proc sql. Currently I am using However, this is not working. Any help greatly appreciated. Answer You could do this in a single query, using conditional joins: Note that you should not have several tables to store the…

Oracle Sql join two tables

I have a query joining two tables. RESULT_TABLE: ID, TEST_RESULT , TEST_STATUS EMAIL_TABLE: ID, EMAIL_TYPE, EMAIL_ADDRESS The RESULT_TABLE will typically have only one result per student. A …