Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL return static strings

Tags:

php

mysql

static

I have a CMS that requires a SQL query to return options/values for a dropdown... typically it returns the rows from the table in the SQL query and fills in the dropdown options. Sometimes I just want to have two static options in the dropdown and do not want to create a whole table to manage those two unchanging items.

My questions is: Is there a MySQL query that will not query a table but will just return some static results as if it were querying a table?

Ideally I would like something similar to this (but static):

SELECT value FROM `fake_table` 

And return the following:

value
//////////////
Option One
Option Two
Option Three
Etc...

Thanks in advance for any help!

like image 810
RANGER Avatar asked May 27 '11 19:05

RANGER


1 Answers

select 'Option One' as Value
union
select 'Option Two' as Value
like image 53
Fosco Avatar answered Nov 15 '22 21:11

Fosco