FatalExceptionError
Technical User
Hello
I am trying to design a query that selects data from multiple tables. I have run into a snag as one of the possible conditions of the select statement pulls from a seperate table.
Here is an example of what I am doing. Assume the variables have already been declared.
Of course you can't do this because you get an error but is there a way I can structure the query so that I can accomplish this.
=======================================
The statement below is true
The statement above is false
There are 10 kinds of people, those who know binary and those who don't
I am trying to design a query that selects data from multiple tables. I have run into a snag as one of the possible conditions of the select statement pulls from a seperate table.
Here is an example of what I am doing. Assume the variables have already been declared.
Code:
Select ID, Name, date, batch,type,
(select batchdate from anotherDB where batchnum = batch)
from someDB
where
(type = 'A' or type ='B')
and (ID like @someID)
and (date > @begin_date and date < @end_date)
and (batchnum like @batch_number)
Of course you can't do this because you get an error but is there a way I can structure the query so that I can accomplish this.
=======================================
The statement below is true
The statement above is false
There are 10 kinds of people, those who know binary and those who don't