DQL != vs <>

In DQL, what is the difference between <> and != ? I have seen != returns 4688 records and <> returns 4689 records i.e. one extra.

Hi @Shankar_Ganguly

!= and <> behave the same. I tested them on an hour of logs in a single query:

fetch logs, from: now() - 1h
| summarize ne_count = countIf(loglevel != “INFO”),
ltgt_count = countIf(loglevel <> “INFO”)

Both returned exactly the same count (303 million+ records). I also checked null and missing fields, and the results were identical.

The extra record you saw is most likely due to timing. With a relative timeframe, each run covers a slightly different window, and new data keeps arriving. Running both in one query, like above, gives a fair comparison.

!= is the one documented in the DQL operators reference, so I’d use that.

Thanks,

Sujit