当前位置:网站首页>How to select several hard coded SQL rows- How to select several hardcoded SQL rows?

How to select several hard coded SQL rows- How to select several hardcoded SQL rows?

2022-07-06 20:13:00 Technology feast

problem :

If you execute this query If you execute this query

SELECT 'test-a1' AS name1, 'test-a2' AS name2

the result will be a one row-selection with two columns having these values: The result will be a single row selection of two columns with the following values :

test-a1, test-a2

How can I modify the above query to have a selection with several rows, eg How to modify the above query to select multiple rows , for example

test-a1, test-a2test-b1, test-b2test-c1, test-c2

I know how to do this with UNION but I feel that there exists a more simple way to do it. I know how to use UNION Do this , But I think there is a simpler way to do this .

PS. Note appended .Sorry for such a basic question, it is very hard to google it. I'm sorry , Such a basic problem , It's hard to Google .


Solution :

Reference resources : https://stackoom.com/en/question/Qcmx
原网站

版权声明
本文为[Technology feast]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202131232094716.html