To select something from the data base we could use:
SELECT * FROM tableName where name="Ed"
But what if I need to select something from a given array, eg:
SELECT * FROM ("Bob","Sam","Ed") where name="Ed"
Is it possible?
Yes it is possible:
http://sqlfiddle.com/#!9/9eecb7d/64737
SELECT t.* FROM
(SELECT "Bob" name UNION SELECT "Sam" UNION SELECT "Ed") t
WHERE t.name="Ed"
But it has almost no sense. Because if you set all data as constant static values you can just:
SELECT "Ed"
there is no reason even to call mysql :-)
SELECT FROM_UNIXTIME(FooTable.Time) FROM (SELECT ('1428384605','1429657398','1429686889') as Time) AS FooTableWHERE time='1429686889' at the end? ;-)
select * from (select 'bob' union select 'sam' union ....) as foo