Ich habe zwei Tabellen seatinfo(siid,seatno,classid,tsid)
und booking (bookid,siid,date,status)
.oracle Query-Fehler: genaue Abruf zurück mehr als angefordert keine der Zeilen
Ich habe Eingabeparameter bookDate, v_tsId, v_clsId. Ich brauche genau eine Reihe (Bookid), um zurückzukehren. Diese Abfrage funktioniert nicht. Ich weiß nicht warum. Wie kann ich es reparieren?
select bookid
into v_bookid
from booking
where (to_char(booking.bookdate,'dd-mon-yy'))=(to_char(bookDate,'dd-mon-yy'))
and status=0
and rownum <= 1
and siid in(select siid
from seatinfo
where tsid=v_tsId
and classid= v_clsId);
Ich habe auch versucht dies:
select bookid
into v_bookid
from booking,
seatinfo
where booking.siid=seatinfo.siid
and (to_char(booking.bookdate,'dd-mon-yy'))=(to_char(bookDate,'dd-mon-yy'))
and booking.status=0
and rownum <= 1
and seatinfo.tsid=v_tsId
and seatinfo.classid= v_clsId;
danke Justin Cave.Yes ich habe ORA-01422: exact fetch gibt mehr als die angeforderte Anzahl von Zeilen "für beide Abfragen. Rownum <= 1 funktioniert gut in PL/SQL.Ich habe versucht, dies (p_bookDate) funktioniert nicht –
@AwladLiton Kannst du "nicht funktionieren" definieren? –
@AwladLiton - Also, was meinst du "' rownum <= 1' funktioniert gut in PL/SQL "? Wenn es" funktioniert ", t Hättest du keinen Fehler bekommen, oder? Aber Sie haben gerade gesagt, dass beide Abfragen, von denen jede eine 'rownum <= 1 '-Klausel hat, Fehler erzeugen. –