Question

Locked

How to write SQL Multiple Selection statement?

By sundayose ·
I have three table in my database as shown below

Voucher Table
V_ID Str.Barcode C_ID
1 HB001 1
2 HB003 2

Client Table
C_ID St_CLientN V_ID
1 Janet B 20
2 Joseph N 15

Village Table
V_ID Str_VillageN
15 Beni
20 Butembo

I need to get a result like this
HB001 Janet B Beni
HB003 Joseph N Butembo

Thanks for your contribution.

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

One way, which may not be relevant to your actual problem

by john.a.wills In reply to How to write SQL Multiple ...

I am assuming that "Str.Barcode" should be "Str_Barcode" and that you have the village names interchanged in your example output.
SELECT Str_Barcode,
St_ClientN,
Str_VillageN
FROM Voucher LEFT JOIN Client ON Voucher.C_ID = Client.C_ID
LEFT JOIN Village ON Client.V_ID = Village.V_ID;

Collapse -

Reponse To Answer

by sundayose In reply to One way, which may not be ...

Thank you.
This worked.

Back to Web Development Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums