Click here to Skip to main content
15,903,362 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i am selecting data from table
SELECT NM.[news_id],
NI.image_Path
,CONVERT(varchar(50), [news_date],106) as news_date
,NM.[news_head]
,NM.[short_news]
,NM.[news_descrip]
,NM.[news_prod]
,NM.[prodduct_id]
,NM.[country]
,NM.[countrycode]
,NM.[news_url]
,NM.[news_source]
,NM.[news_status]
,NM.flag
,NM.Status
,NM.[RowNo]
,NM.[UpdatedON],NM.ActionName FROM NewsMaster NM INNER JOIN news_images NI on NM. news_id = NI.news_id
where --Created_Date = convert(varchar(10), getdate(), 102)
Flag IS NULL
order by NM.news_date desc

What I have tried:

above is my query i want to know how to give condition
if my value is null flag column and value in status column null then i found data

but when my value is null in flag column and value is 5 in my status column then data not found so please help how to use condition in where condition
Posted
Updated 3-Jun-17 0:30am

1 solution

Do you mean
SQL
WHERE Flag IS NULL AND Status IS NULL


[edit]:doh:![/edit]
 
Share this answer
 
v2
Comments
Member 12183079 3-Jun-17 6:36am    
Thank You
OriginalGriff 3-Jun-17 7:29am    
You're welcome!
[no name] 3-Jun-17 8:15am    
"&&" in SQL?
OriginalGriff 3-Jun-17 8:28am    
It's a Saturday, and I have my MySql brain on... :O
[no name] 3-Jun-17 8:31am    
Same ("&&") happens to me also ofeten during week :-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900