🔒 Closed Table joining

Status
Not open for further replies.

Netflix

Forum Veteran
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
  • 516
    Views
  • 2
    Participants
Last reply from:
Zyzz

Trending Topics

Online now

Members online
1,337
Guests online
3,481
Total visitors
4,818

Forum statistics

Threads
2,305,879
Posts
29,168,309
Members
1,195,477
Latest member
Jomar Gabriel
Back
Top