Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Make your voice heard. Take the 2019 Developer Survey now

Questions tagged [operator]

The tag has no usage guidance.

4
votes
2answers
146 views

Different syntax to add/substract interval

Till now I used the following syntax to add an interval to a timestamp: select now() + '5 year'; This worked fine till I tried to subtract the interval which results in a syntax error. invalid ...
6
votes
1answer
142 views

What does the vertical pipe slash operator do?

I'm wondering what pipe slash |/ does in, SET equal_area_radius = |/area/pi(); The statement works and it definitely changes the value: SELECT |/125.555/pi(); -- returns: 6.32181918120139 SELECT ...
0
votes
2answers
26 views

Operand data type time is invalid for add or subtract operators

I'll to calculate how many hours a person has worked on SQL server. For that I'm storing the Arrival, Departure and Break in my database table as time(7). A bit for DepartureNextDay determinate that ...
3
votes
1answer
49 views

What does @ signify in a query expression?

What does the @ symbol signify in this sql expression? update some_table set some_number=(@some_number+1) where some_id=1; It seems to return the same result as: update some_table set some_number=...
0
votes
1answer
94 views

MariaDB are bitwise operators defined on strings?

Is the behavior of BITAND, (bitwise and) defined in MariaDB over strings? SELECT '0011' & '0011', 'ff' & 'ff', 'yy' & 'YY', '5' & '5'; +-----------------+-------------+-------------+--...
1
vote
1answer
117 views

MongoDB: operator to match arrays whose elements are all contained in a specified array

The $all operator selects the documents where the value of a field is an array that contains all the specified elements. In my situation I need the opposite: an operator that selects the documents ...
0
votes
2answers
2k views

What does `<>` mean?

What does <> do in the following WHERE clause, WHERE posn_id <> rid
2
votes
4answers
2k views

ERROR: operator does not exist: text[] ~~ text

We have an easy syntax that allows us to look into an array for a single scalar, SELECT 'foo' = ANY(ARRAY['foo', 'bar', 'baz']); We can use the same method to match with LIKE SELECT 'foobar' LIKE ...
0
votes
2answers
89 views

Is it possible to schema-qualify an operator?

Let's say I create an extension, like PostGIS, in the schema postgis, CREATE EXTENSION postgis WITH SCHEMA postgis; Is it possible to fully qualify an operator like && in the below example, ...
6
votes
1answer
9k views

PostgreSQL custom operator UUID to varchar

I have a rather complicated Postgres database in which many UUID fields were incorrect stored as VARCHAR. I'd like to migrate them over in piecemeal, but unfortunately, doing so breaks all my views as ...
3
votes
0answers
1k views

SQL Server alerts not sending notification emails to the operator

I have setup few SQL Server alerts and added Operator to notify if any alert occurred. I just noticed that couple of alerts did occurred but we didn't receive any alert email. I did send a test ...
4
votes
1answer
144 views

Does the || operator in Postgres result in a blank result if one of the columns is blank?

I am running a query in Postgres using the || operator to concatenate some columns and it seems where one of the columns is blank the whole result is blank. Is that normal || behaviour? With "blank" ...
7
votes
4answers
41k views

Select multiple values in LIKE Operator

I have a SQL query given below, I want to select multiple value using like operator. Is my Query correct? SELECT top 1 employee_id, employee_ident, utc_dt, rx_dt FROM employee INNER JOIN ...
3
votes
1answer
1k views

Why does a JSON element return text when it's not text?

When I try to access a JSON element using ->>'elementName' I get a texttype. SELECT pg_typeof(x1->>'a'), jsonb_typeof(x2) FROM ( VALUES ('{"a":5}'::jsonb, '5'::jsonb) ) AS t(x1,x2); ...
0
votes
2answers
670 views

Compare an hour between two hour columns

Please help. I am kinda new to this database world. I am using PostgreSQL. I have a table with defined shifts like this: CREATE TEMPORARY TABLE shifts AS SELECT id, start_hour::time, end_hour::time ...
70
votes
4answers
8k views

Authoritative source that <> and != are identical in performance in SQL Server

Consider this answer on SO that reassures the asker about the <> operator that: <> is ... the same as !=. But then a commenter pipes up and says: It's true that they are, ...
4
votes
1answer
360 views

PostgreSQL behaviour in presence of two different type of indexes on the same column

How does PostgreSQL behave if I create two (or more) indexes of different type on the same column? In my case I want to compare B-Tree indexes against GIN on a tsvector column. I know that GIN are ...
3
votes
1answer
6k views

How does the operator “&” work in sql server?

I was running a trace on one of our test servers when someone did this: and one of the queries I could catch in the trace was: declare @UserOption int select @UserOption=convert(int, c.value) from ...
8
votes
1answer
1k views

What is BMK Operator in SQLServer

I was trying to answer this question stating from clause is optional..But i am stuck with an Operator in plan..below is screenshot of execution plan .. As you can see there is BMK operator in query ...
5
votes
2answers
3k views

Difference between “<> ANY(…)” and “NOT = ANY(…)”?

Could you please explain the difference between these two operators? sID != smth and not sID = smth. At a first glance they seem perfectly equal. But they give different results.
2
votes
2answers
566 views

MongoDB aaS - administrate volumes/disk size - consequences of full volume - new file allocation failure

We run MongoDB (currently 3.0.6) as a Service. MongoDB is running inside Docker Container with a small volume 8 GB where mongod data files are stored permanent. The volume can't be extended. This is ...
4
votes
1answer
116 views

Are operators also considered to be keys?

I'm taking a MongoDB course and one of the assignments asks to include quotes around keys. So I did for a query like this {$push: {"key":value}} But I was told that $push is also a key because it's ...
7
votes
1answer
9k views

Querying JSONB in PostgreSQL

I have a table, persons, which contains two columns, an id and a JSONB-based data column (this table has just been made for demonstrational purposes to play around with PostgreSQL's JSON support). ...
2
votes
1answer
82 views

Unable to change Agent Operators

I am trying to change a SQL Agent Operator in my system and it will not let me. I have sa but I think it's partially due to how I'm doing it. I'm trying to modify the operator with the name NIT and ...
2
votes
1answer
658 views

Performance of bitwise operators on byte column vs individual bit columns

I'm designing a database schema at the moment, but have a performance query. Our table needs to have (at least) two flags, or boolean values. We can call these IsComplete and IsExportable. The ...
6
votes
1answer
901 views

PostgreSQL operator uses index but underlying function does not

I'm attempting to use JSONB with JDBC, which means that I have to avoid any of the operators which use the '?' character (as the PostgreSQL JDBC driver has no escaping for this character). Taking a ...
4
votes
1answer
758 views

what does !! as an operator in mysql?

I tried to use the exclamation mark as a not operator in a query SELECT !0, !!0, !!!0, !1, !!1, !!!1, !2, !!2, !!!2; | !0 | !!0 | !!!0 | !1 | !!1 | !!!1 | !2 | !!2 | !!!2 | |----|-----|------|----|-...
4
votes
1answer
2k views

What does the Postgres <-> operator do?

I was reading through the Postgres documentation on materialized views and in one example they use the following: SELECT word FROM words ORDER BY word <-> 'caterpiler' LIMIT 10; I tried to run ...
14
votes
1answer
26k views

EXCEPT operator vs NOT IN

The EXCEPT operator was introduced in SQL Server 2005 but what is the difference between NOT IN and EXCEPT ? Does it do the same? I would like a simple explanation with an example.
1
vote
1answer
929 views

Removing a Key From HSTORE in Postgresql

At the moment I have an hstore that describes the properties of various items. When searching I need to remove values that are unique to a each item (such as serial number, vin, and so on). According ...
5
votes
1answer
967 views

PostgreSQL custom operator for equality

I want to build a custom equality operator in PostgreSQL, which can be used in GROUP BY, UNION and DISTINCT [ON] for the json type (just for the sake of curiosity, not for real-world implementation -- ...
5
votes
2answers
254 views

'+' operator with one operand!

How does '+' operator behave in following statement? select + 'taco'; --Result is 'taco' Is it doing string concatenation with first string blank ('' + 'taco'), or does it mean something else?