Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Return Value from sql commands

Tags:

sql

mysql

I am currently using the SQL command

Select * from where name='john'

Is it possible to return 20 no matter the query, for example

Select * from where name='john' or return = 20
like image 585
gaurav singh Avatar asked Aug 03 '26 23:08

gaurav singh


1 Answers

EDIT If you have an oracle database you can do something like that:

SELECT * 
FROM dual
WHERE 1=0
UNION
SELECT '20'
FROM dual;
like image 151
scatolone Avatar answered Aug 05 '26 15:08

scatolone