subquery and search form

Questionssubquery and search form
rezky asked 9 years ago

hi

why when using the search form in grid, subquery is not running?

Could not execute query. ORA-00907: missing right parenthesis – SELECT count (*) as c FROM (SELECT 1 FROM LAP_X h as c "AND" substr (TGL, 0,4) = '2014' GROUP BY DATE) o

should not "AND" but "WHERE"

2 Answers
rezky answered 9 years ago

this my query

SELECT SUBSTR(TGL,5,2) AS TGLX,
substr(last_day(to_date(TGL,'rrrrMM')),-2) AS day,
( ( ( select sum(JUM) from lap_x d WHERE d.sat = 'XXX'
AND d.tgl= h.tgl) + ( select sum(JUM*62.744) from lap_x d WHERE d.sat= 'YYY'
AND d.tgl= h.tgl) )/1000) AS XXX
FROM
lap_x h
GROUP BY TGL

Abu Ghufran answered 9 years ago

Please send CREATE TABLE query along with sample dump to regenerate this issue.

Also try quick fix:
append WHERE 1=1 before GROUP BY

Your Answer

0 + 18 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?