String query= "select atm.Id_Track,"
+"(Select Tm.Title From Track_Master Tm Where Tm.Id_Track = Atm.Id_Track) Track_Title,"
+"(Select Tm.Isrc From Track_Master Tm Where Tm.Id_Track = Atm.Id_Track) Track_Isrc,"
+"(select am.title from album_master am where am.id_album= atm.id_album) album_title,"
+"(select am.catalog from album_master am where am.id_album= atm.id_album) album_catalog"
+"from album_track_mapping atm, album_master alb where alb.catalog =? and atm.id_album_original = alb.id_album and atm.id_album <> alb.id_album";
将错误视为
ORA-00923:来自未指定的关键字
请提出任何建议。 提前致谢
答案 0 :(得分:1)
您在FROM之前缺少空格,因此正确的查询将是:
String query= "select atm.Id_Track,"
+"(Select Tm.Title From Track_Master Tm Where Tm.Id_Track = Atm.Id_Track) Track_Title,"
+"(Select Tm.Isrc From Track_Master Tm Where Tm.Id_Track = Atm.Id_Track) Track_Isrc,"
+"(select am.title from album_master am where am.id_album= atm.id_album) album_title,"
+"(select am.catalog from album_master am where am.id_album= atm.id_album) album_catalog "
+"from album_track_mapping atm, album_master alb where alb.catalog =? and atm.id_album_original = alb.id_album and atm.id_album <> alb.id_album";
答案 1 :(得分:0)
请尝试以下操作:
String query= "select atm.Id_Track,"
+"(Select Tm.Title From Track_Master Tm Where Tm.Id_Track = Atm.Id_Track) Track_Title,"
+"(Select Tm.Isrc From Track_Master Tm Where Tm.Id_Track = Atm.Id_Track) Track_Isrc,"
+"(select am.title from album_master am where am.id_album= atm.id_album) album_title,"
+"(select am.catalog from album_master am where am.id_album= atm.id_album) album_catalog"
+" from album_track_mapping atm, album_master alb where alb.catalog =? and atm.id_album_original = alb.id_album and atm.id_album <> alb.id_album";
它显示ORA-00923:From keyword not specified
,因为您在最后一行from
之前缺少空格字符。