SELECT
BOWLERFIRSTNAME || ' ' || BOWLERLASTNAME
"Bowler Name" ,
BOWLERADDRESS || ' ' || BOWLERCITY || ' ' || BOWLERSTATE || ' ' || BOWLERZIP
"Bowler Address"
FROM BOWLERS;
SQL 输出:
Bowler Name
------------------------------ ------------------------------ ----------
Bowler Address
------------------------------ ------------------------------ --------------------
Michael Viescas
218 Main Street Redmond WA 98052
Bailey Hallmark
Route 2, Box 203B Woodinville WA 98072
Rachel Patterson
16 Maple Lane Auburn WA 98002
Bowler Name
------------------------------ ------------------------------ --------------------
Bowler Address
------------------------------ ------------------------------ --------------------
Steve Pundt
722 Moss Bay Blvd. Kirkland WA 98033
Joe Rosales
908 W. Capital Way Tacoma WA 98401
选择了 32 行
输出应该是:
Bowler Name Bowler Address
------------------------------ -------------------------
Rachel Patterson 16 Maple Lane Auburn WA 98002
我不知道我做错了什么。
最佳答案
试试这个:
SELECT (BOWLERFIRSTNAME || ' ' || BOWLERLASTNAME) AS "Bowler Name" ,
(BOWLERADDRESS || ' ' || BOWLERCITY || ' ' || BOWLERSTATE || ' ' || BOWLERZIP) AS "Bowler Address"
FROM BOWLERS;
关于mysql - SQL 输出不是预期的。我究竟做错了什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46084398/