Reputation: 856
I know yo can do: SELECT "javier" as names;
# names
-----
1 javier
There is any way to get a custom field with user defined values for each row? something like SELECT ("javier","piter", "mike"); And obtain:
# names
-----
1 javier
2 piter
3 mike
Upvotes: 1
Views: 845
Reputation: 49260
select 'javier' as names
union all
select 'piter'
union all
select 'mike'
...
You can use union all
.
If you need a column with auto rownumbers, you could do
select @rn := @rn+1 as `#`, names
from (
select 'javier' as names
union all
select 'piter'
union all
select 'mark') x,
(select @rn := 0) t
Upvotes: 2