下面是我写的一段 SQL 代码。我想将两条记录合并到一条记录中,其中第一条记录域显示为“来自源”,第二条记录的域变为“到域”。我需要做更多的过滤,但为什么这个简单的语句不起作用?
我收到错误“输入末尾的语法错误”
*SELECT
"ID" , "Time", "Source Domain", "To Domain" From
(SELECT "RecordID" As "ID","UTCTimestamp" As "Time","Domain" As "Source Domain" FROM public."Traffic - Mobile")T1
Inner Join Lateral
(SELECT "Domain" As "To Domain" FROM public."Traffic - Mobile" where "RespondentID"="T1"."RespondentID" )T2*
提前致谢
PostgreSQL 版本 9.3