question

artisltover avatar image
artisltover asked

Where clause where city and state are the same but zip codes are different but they need to be grouped into one

I have a where clause that makes sure two tables have equal zips and equal city names. If the same city has two zips then it puts two records. I need the where to put one record if city and state are same and zips are different. I'm having trouble figuring out how to code that in the where clause.code is :shipre srleft joinutilzip uz on sr.azip = uz.bzipand sr.bcity = uzbcitySo when they don't equal new record. Its still same shipment.If truck takes a load to walmart in same city two walmarts with different zips its still same truck. Example of what i need and am struggling with.

sqlserver2012
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.