🔒 Closed Table joining

Status
Not open for further replies.

Netflix

Established
What is the right query for joining 3 tables..
I want to make a view out of the 3 tables where Its populated by the data of 3 tables..
I want to display provCode from refprovince table ,citymunCode from refcitymun and brgyCode from refbarangay and also give them a distinct ID ..

CREATE VIEW ADRESSBOOK AS SELECT B.brgyCode AS BrgyCode, P.provCode AS ProvCode, C.citymunCode,
B.brgyCode
FROM [refprovince] P
JOIN refcitymun C ON P.provCode = C.provCode
JOIN refprovince P ON P.provCode = B.provCode
ORDER BY B.brgyCode

brow.png 3.png 2.png
 
Status
Not open for further replies.

About this Thread

  • 1
    Replies
  • 523
    Views
  • 2
    Participants
Last reply from:
Zyzz

Trending Topics

Online now

Members online
1,242
Guests online
3,476
Total visitors
4,718

Forum statistics

Threads
2,330,686
Posts
29,255,366
Members
1,151,244
Latest member
nicasahh
Back
Top