R
R
Roquie2014-09-10 19:22:28
PostgreSQL
Roquie, 2014-09-10 19:22:28

How to make a selection by coincidence of one value from N fields?

something like this (the syntax itself is not correct):

SELECT email,account,mobile_phone AS fields FROM users WHERE fields = "[email protected]"

or
SELECT email,account,mobile_phone FROM users WHERE [email,account,mobile_phone] = "[email protected]"

I'm interested in the option without union or like, if there is such a thing at all ...
* The number of fields can be 10 - 20 pieces. Writing WHERE ... OR seemed not a very good idea

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2014-09-10
@Roquie

SELECT email,account,mobile_phone FROM users WHERE email = '[email protected]' OR account = '[email protected]' OR mobile_phone = '[email protected]'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question