asp.net - SQL Sub Query NO execute if null -


I was wondering if my @ id1 tap was there any way to not perform my subconscious?

  formation process [DBO] [Test Table Search] @ Call 1 Int, @ Call 2 Unique Identifier, @ Call 3 Datam, @ Call 4 Data, @ Id 1 Wakr (10) SST Translation Accolation Level Select CAD * Read [DBO]. [TestTable] WHERE [Col1] = COALESCE (Col1, Col1) and [Col2] = COALESCE (Col2, Col2) and [Col3]> = COALESCE (@ Col3 + "00:00:00", Col3) and [Col4] & Lt; = COALESCE (@ Col4 + "23:59:59", Col4) and [Col5] IN (SELECT [ID2] FROM [dbo]. [TestTable2] WHERE [ID1] = @ ID1)  

Not sure about your meaning, but maybe this is what you are looking for:

[test table] where [Col1] = COALESCE (Col1, Col1) and [Col2] = COALESCE (Col2, Col2) and [Col3]> = COALESCE (@ Col3 + "00:00:00", Col3) and [C-Ol4] & lt; = COALESCE (@ Col4 + "23:59:59", Col4) AND (@ ID1 IS Null or [Col5] IN (SELECT [ID2] FROM [dbo]. [TestTable2] WHERE [ID1] = @ ID1)

Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -