Quantcast
Channel: Subquery in SQL
Viewing all articles
Browse latest Browse all 7

Subquery in SQL

$
0
0

Hi Experts

I am having two tables with one to many relationships and want to see oly the top 1

here are the details

Details Table

PK_Details    FK_Customer    Invoice

1                     1                   100

2                     2                   250

3                     3                   400

4                     3                   600

Customer Table

PK_Customer    Code    Name

1                     001      SMS

2                    002       CBIT

3                    003        EIT

4                    004        MIT

I want to get the values from two tables  but only the top 1

Something like below

PK_Customer    FK_Details

3                          3


Dasari



Viewing all articles
Browse latest Browse all 7

Latest Images

Trending Articles





Latest Images