Forum Stats

  • 3,838,561 Users
  • 2,262,383 Discussions
  • 7,900,687 Comments

Discussions

show all locations that do not meet certain requirements

Bjornlaat
Bjornlaat Member Posts: 20 Green Ribbon

shows all location_gid which have no CUSTOMER

LOCATION table sample data:

LOCATION_GID

1

2

3

4

5


LOCATION_ROLE_PROFILE table sample data

LOCATION_GID, LOCATION_ROLE_GID

1, CUSTOMER

1, SHIPFROM/SHIPTO

2, SHIPFROM/SHIPTO

3, CUSTOMER

3, SHIPFROM/SHIPTO

4, CUSTOMER

4, SHIPFROM/SHIPTO

5, CARRIER


We want to create an SQL query of all location_gid of the table location that do not have a CUSTOMER in the table LOCATION_ROLE_PROFILE

As you can see in the example, there are multiple records of 1 location_gid in the table LOCATION_ROLE_PROFILE. 

The results that should come back from the example are: location_gid: 2 and 5

Best Answer

Answers