🔒 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
  • 500
    Views
  • 2
    Participants
Last reply from:
Zyzz

Trending Topics

Online now

Members online
1,062
Guests online
844
Total visitors
1,906

Forum statistics

Threads
2,274,941
Posts
28,959,487
Members
1,233,488
Latest member
lea11sales
Back
Top