If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > inverting the recordset

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-14-09, 14:35
cjcunningham cjcunningham is offline
Registered User
 
Join Date: Sep 2008
Posts: 1
inverting the recordset

To all: This is my first time posting here. Any input would be greatly appreciated.

Below is a SQL statement that I am using in my MS Access database.

(I know this is the MySQL discussion forum, but this is more of a SQL question than it is an Access question.)

My problem is that I want the opposite recordset than what this SQL statement produces.

In my test database, there are three records in the table tblFoods. This SQL statement returns two of those three records. I would like, instead, to have the other (one) record returned.

What is the best/easiest way of inverting this recordset?

Any input would be greatly appreciated.

Thx,

CJinMadison

--- START SQL STATEMENT ---

SELECT tblPatients.PtID, tblFoods.FoodDescr
FROM tblFoods
INNER JOIN (tblFoodConflict
INNER JOIN (tblPatients
INNER JOIN tblPatientConflict ON tblPatients.PtID =
tblPatientConflict.PtID)
ON tblFoodConflict.AlgyDietID = tblPatientConflict.AlgyDietID)
ON tblFoods.FoodID = tblFoodConflict.FoodID;

--- START SQL STATEMENT ---
Reply With Quote
  #2 (permalink)  
Old 05-14-09, 23:26
leonel.machava leonel.machava is offline
Registered User
 
Join Date: May 2009
Posts: 5
Hi!

Give us concrete examples. If possible show us the tables with some (unreal) data.

Peace!
Reply With Quote
  #3 (permalink)  
Old 05-15-09, 02:11
healdem healdem is online now
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,260
is this a general question on SQL.. if so AnSI sql may well be the appropriate section, if its about MySQL then here is fine. if you want to do that in access then ask the question in Access

its all to do with your join statement.
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On