0





104
1

I have a database in access 2013, and I want to select from 2 of it's tabale in one command, this is my try:

OleDbDataAdapter DataA = new OleDbDataAdapter(@"Select FeedName from tFeeds where FeedID IN (Select FeedID from tFeedsRations),
                                                        FeedQuantity from tFeedsRations", Connection);
        DataTable DTable = new DataTable();
        DataA.Fill(DTable);

but it gives:

syntax error (comma) in query expression 'FeedID IN (Select FeedID from tFeedsRations)

is it possible to do smoething like that at all?

Question author Saranio | Source

0


1

Select FeedName from tFeeds where FeedID IN (Select FeedID from tFeedsRations), FeedQuantity from tFeedsRationsis not valid SQL.

It looks like you're trying to perform a join, which would be does as follows.

SELECT tf.FeedName, tfr.FeedQuanity FROM tFeeds AS tf INNER JOIN tFeedsRations AS tfr ON (tf.FeedID = tfr.FeedID)

Answer author Collin-stevens

Ask about this question here!