|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi guys...got a problem here....
I got a query which joins two table.... Individual fid1 fQSname fQSRegno Point fid2 fQSRegno fQSPoint Tables join using fQSRegno. Scenario is
Query1 fid3 fQSname fQSRegno *from tblPoint fQSPoint the data shows only members who got points. Is it possible to include member who don't have point like new registred member to show in this query.... TQ |
|
#2
|
||||
|
||||
|
Yes, you need to do what is known as an outer join on the 'Individual' table. This will list all of the individuals regardless of whether they have a 'point' record or not. Check out the syntax for your SQL Environment, but as a guide, the following code is how I would do it, and is pretty universal in its notation:
Code:
Select * From Point, Individual Where fid1 =* fid2 the above should fill a NULL into the spaces where there are no records for the FID2 field. N.B. As a rule the * in a *= join always is on the side where you wish to insert NULL records. |
|
#3
|
||||
|
||||
|
try this
Code:
SELECT A.fQSname, B.fQSPoint FROM Individual As A LEFT OUTER JOIN Point As B On (A.fQSRegno = B.fQSRegno) ORDER BY A.fSQname |
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > Subquery EXISTS NOT EXISTS |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|