Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Complicated query: searching for results within results.

Re: Complicated query: searching for results within results.

From: Charles Hooper <hooperc2000_at_yahoo.com>
Date: 20 Nov 2006 05:19:53 -0800
Message-ID: <1164028793.081768.220130@h54g2000cwb.googlegroups.com>


Michel Cadot wrote:
> "Charles Hooper" <hooperc2000_at_yahoo.com> a écrit dans le message de news: 1163983841.115538.107430_at_m7g2000cwm.googlegroups.com...
> | Your post appears to be in response to the long winded solution that I
> | provided. As a _former_ computer instructor, I beg to differ with the
> | notion that only hints should be provided when potentially complex
> | questions are asked. Hints work well in a classroom environment where
> | there is both a verbal and non-verbal immediate exchange between
> | instructor and student. However, hints in a static, written format may
> | not serve as motivation to encourage thought processes - those hints
> | may be read as the master playing games with the novice or even as a
> | way of insulting the novice's intelligence, when that is far from the
> | intended result.
> |
> | I agree, just providing a solution to a specific problem has limited
> | benefits to the recipient if the solution. Providing insight into the
> | thought processes that lead to each step of the solution is far more
> | helpful - make connections between what is familar to those learning
> | something new, with something that is a bit different.
> |
> | Charles Hooper
> | PC Support Specialist
> | K&M Machine-Fabricating, Inc.
> |
>
> No Charles, Daniel post is not for you. He did remind me to take care
> about lazy students many times during the past years... and from to
> time to time I slacken my attention and post a solution.
> (I don't either think his post was just for me, it is just a general warining.)
>
> I'm not agree with you Charles, hints are very useful and students
> can find the solution with those we post here if they want to make
> an effort, at least the effort to ask if they don't understand what we
> post. Obviously, they should talk with their teachers before posting
> here, if they want a more interactive discussion.
> Hints are not a way to play master but a way to help student to learn.
>
> Providing insights into the solution is only useful if poster want to
> understand and not just a solution. How to mae the distinction
> between the two types of posters? Well, by posting hints and see
> which ones try and ask for more and which ones don't answer.
> (imho)
>
> Regards
> Michel Cadot

I think that we are more in agreement than not regarding the use of hints to help someone learn.

When used appropriately, hints serve as motivation for deep understanding of subjects. I use hints when trying to help the IT staff who report to me understand concepts that not taught in college/university. This approach requires immediate feedback - if the dots (hints) are spaced too far apart, there is little chance that the learner will be able to connect the dots, which then may result in feelings of frustration, that Oracle (or some other topic) is too difficult to comprehend, or that the person providing the hints is just insulting the lack of intelligence of the person asking the question. While responses on the Oracle Usenet groups is still suprisingly quick, providing answers with only hints is a bit like playing a chess game by postal mail. Some people who ask questions here may have run into a difficult Oracle related problem at work, where a solution is required in a short period of time, or their project simply does not get off the ground. Providing a hint in such a situation may result in an inappropriate response to someone who is actually trying to help (read some of the out-of-line responses that Mr. Morgan has received when trying to be helpful, if you need examples).

While I don't ask many questions here, I find that it is interesting to read the responses to other's questions. While providing insight for the OP may be wasted effort, others reading the responses may find new approaches to solving complex problems,such as using analytical functions rather than a half dozen nested inline views.

It is interesting to see the variety of solutions and results posted in this thread.
SQL> SELECT
  2 *
  3 FROM
  4 TABLE_1
  5 ORDER BY
  6 A,
  7 B,
  8 C;

         A B C
---------- ---------- ----------

         1          1          5
         1          1        100
         1          2          4
         1          2          4
         2          1          5
         2          1          5
         2          1        100
         2          1        100
         3          1          5
         3          2          8
         3          2         10

----------------------------------------------------------------------------------
SQL> SELECT
  2 A,
  3 DECODE(SIGN(SUM(UNIQUE_VALUES_FOUND)),1,'TRUE','FALSE') UNIQUES_FOUND
  4 FROM
  5 (SELECT
  6      A,
  7      B,
  8      C,
  9      1-SIGN(COUNT(*) OVER (PARTITION BY A,B,C)-1)
UNIQUE_VALUES_FOUND
 10 FROM
 11 TABLE_1)
 12 GROUP BY
 13 A;

         A UNIQUES_FOUND

---------- --------------------------------
         1 TRUE
         2 FALSE
         3 TRUE
----------------------------------------------------------------------------------
SQL> select a, b, count(distinct c) nb_c   2 from table_1
  3 group by a, b
  4 having count(distinct c) > 1
  5 order by a, b;

         A B NB_C
---------- ---------- ----------

         1          1          2
         2          1          2
         3          2          2
----------------------------------------------------------------------------------
SQL> select case when count(distinct B) <> count(distinct B||'-'||C) then
  2 'true' else 'false' end
  3 from TABLE_1
  4 where A = 1;

CASEWHENCOUNT(DISTINCTB)<>COUN



true

SQL> select case when count(distinct B) <> count(distinct B||'-'||C) then
  2 'true' else 'false' end
  3 from TABLE_1
  4 where A = 2;

CASEWHENCOUNT(DISTINCTB)<>COUN



true

SQL> select case when count(distinct B) <> count(distinct B||'-'||C) then
  2 'true' else 'false' end
  3 from TABLE_1
  4 where A = 3;

CASEWHENCOUNT(DISTINCTB)<>COUN



true

Charles Hooper
PC Support Specialist
K&M Machine-Fabricating, Inc. Received on Mon Nov 20 2006 - 07:19:53 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US