-
What do you mean by diff result?. If you want to display only weekday result then filter the rows by using DATEPART function with DW parameter.
-
select
DMA,Dates,case when datepart(dw,Dates) in (7,1) then 'Weekend' else 'WeekDay' end from dma
-
Thanks again. Another Question.
I have tables as below.
Table A
DMA CD Zip_code
-------------------------------
501 2708 07625
501 2708 07624
201 2708 07628
201 2709 07625
201 2706 07248
Table B
State zip_Code
-----------------
NJ 07624
NJ 07625
NY 10023
NY 10024
So I join the Table A & Table B with Zip_Code I get only matching rows. How I can get non matching rows. I know it is with join type.
Thanks.
-
select a.dma, a.cd, a.zip_code, b.state
from tablea as a
left outer join tableb as b
on a.zip_code = b.zip_code
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|