Skip to content
Advertisement

SELECT statement with where clause on Column

I am trying to gather some data from a table with INNER JOIN with another table. What I am trying to get have 2 Types and I need to separate these 2 types in 2 different columns.

In table where I am Inner joining have a column called ‘Data’ and another Column called ‘Type’ depending on the type of data I need to separate them when I inner join this table with another one.

Here is my script that I am trying to run:

But when I run this I get everything NULL for Time. How can I put a where clause on a column in statement? to only get the Type ‘T’ for Time value?

In the Table Store Schedule Data, each store has entry values entered ONE is the time and other is the DAY and its separated and pulled depending on the Type. If you want to look at the days of the week store runs you pull the TYPE D and if you want Time you pull TYPE T. But pulling this in an inner join is something I am stuck on.

EDITED: THIS is what data looks like in StoreScheduleDataID

Desired output:

I get this with the 1st answer given:

Advertisement

Answer

Maybe this:

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement