cancel
Showing results for 
Search instead for 
Did you mean: 

help with query

Former Member
0 Kudos

Hi

From table CRD1 "bp addresses" I need a simple query to select when the "block" field of the "Ship to" address for a BP is the same as the "block" field of that BP's "Bill to" address..........sorry I am new to SQL!!

regards

Steve

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Vijay

Your query returns all BPs irrespective of whether the block of the "Ship to" is the same as block of "Bill to"

Thanks

Steve

vijay_kumar1
Contributor
0 Kudos

Hi Steve,

It works for me, try this query if it works

select block,cardcode from crd1 group by block,cardcode having count(block)>1

Regards,

Vijay kumar

Answers (1)

Answers (1)

vijay_kumar1
Contributor
0 Kudos

Hi Steve,

You could try this query

SELECT * FROM CRD1 T0 where adrestype ='B' and block in (select block from crd1 where adrestype='S')

Regards,

Vijay kumar