Link to home
Start Free TrialLog in
Avatar of triphen
triphen

asked on

SQL Syntax

Hey guys,

I have 2 tables....Trans and TransDetails

I am trying to select the (TransNum)'s from the Trans table where they only have 1 record in the TransDetail table and that record's ProdID is = 111.


Trans
TransNum        FinalTotal
1                        25
2                        15
3                        73
4                        34
5                        98



TransDetails
Unique ID              TransNum            ProdID
1                            1                             111
2                            1                             259
3                            1                             854
4                            2                             111
5                            3                             111
6                            3                             665
7                            3                             811
8                            3                             911
9                            4                             111
10                          4                             654
11                          4                             785
12                          4                             215
13                          4                             614
14                          5                             111

In this example I want the query to return TransNum 2 and 5.


SyBase SQL Anywhere v10
ASKER CERTIFIED SOLUTION
Avatar of Pratima
Pratima
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of triphen
triphen

ASKER

You rock!