Home » Other » Training & Certification » Can any one solve this
Can any one solve this [message #289603] Mon, 24 December 2007 04:36 Go to next message
balajiags
Messages: 10
Registered: July 2007
Junior Member
I want to display the same output generated by following query
with the help of PL/SQL .
SELECT 1 , 2 ,3 ,4 ,5  FROM DUAL
UNION ALL
SELECT 16,17,18,19,6 FROM DUAL
UNION ALL
SELECT 15,24,25,20,7 FROM DUAL
UNION ALL
SELECT 14,23,22,21,8 FROM DUAL
UNION ALL
SELECT 13,12,11,10,9 FROM DUAL
Re: Can any one solve this [message #289604 is a reply to message #289603] Mon, 24 December 2007 04:46 Go to previous messageGo to next message
Michel Cadot
Messages: 64131
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
We don't do homework for you.
Post what you already tried.

Regards
Michel
Re: Can any one solve this [message #289610 is a reply to message #289604] Mon, 24 December 2007 05:11 Go to previous messageGo to next message
balajiags
Messages: 10
Registered: July 2007
Junior Member
This is my previousprogram answer.I get the result what i want.

declare
    n number :=5;
    m number :=11;
    a number;
    begin
    for x in 1..M loop
    dbms_output.put_LINE(' ');
    for y in 1..m loop
    a:=x*y;
   dbms_output.put(LPAD(a,4));
   exit when a= x*10;
   end loop;
   end loop;
  end;
Re: Can any one solve this [message #289611 is a reply to message #289610] Mon, 24 December 2007 05:17 Go to previous messageGo to next message
Michel Cadot
Messages: 64131
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:

I get the result what i want.

So problem is solved?
I don't think you get the same output with your PL/SQL block and your query.

Regards
Michel
Re: Can any one solve this [message #289612 is a reply to message #289611] Mon, 24 December 2007 05:24 Go to previous messageGo to next message
balajiags
Messages: 10
Registered: July 2007
Junior Member
That is my previous question for output like below.

1   2   3   4   5   6   7   8   9  10
2   4   6   8  10  12  14  16  18  20
3   6   9  12  15  18  21  24  27  30
4   8  12  16  20  24  28  32  36  40
5  10  15  20  25  30  35  40  45  50
6  12  18  24  30  36  42  48  54  60
7  14  21  28  35  42  49  56  63  70
8  16  24  32  40  48  56  64  72  80
9  18  27  36  45  54  63  72  81  90
10  20  30  40  50  60  70  80  90 100


and this time i want o/p for the below query by PL/SQL.

SELECT 1 , 2 ,3 ,4 ,5  FROM DUAL
UNION ALL
SELECT 16,17,18,19,6 FROM DUAL
UNION ALL
SELECT 15,24,25,20,7 FROM DUAL
UNION ALL
SELECT 14,23,22,21,8 FROM DUAL
UNION ALL
SELECT 13,12,11,10,9 FROM DUAL
Re: Can any one solve this [message #289623 is a reply to message #289612] Mon, 24 December 2007 07:14 Go to previous messageGo to next message
Michel Cadot
Messages: 64131
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
So what did you try to achieve the result you want?

Regards
Michel
Re: Can any one solve this [message #289826 is a reply to message #289623] Wed, 26 December 2007 04:14 Go to previous messageGo to next message
balajiags
Messages: 10
Registered: July 2007
Junior Member
One of my friend forward this to me & give me 4 month timing.
He want result in any language.
c,c++,java,.net,cobol
Re: Can any one solve this [message #289836 is a reply to message #289826] Wed, 26 December 2007 04:31 Go to previous messageGo to next message
Littlefoot
Messages: 20900
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
So come back in April to show us what you did; someone will surely help you to solve a problem if you won't be able to do it yourself in next 4 months.
Re: Can any one solve this [message #290086 is a reply to message #289826] Thu, 27 December 2007 06:13 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Nice friends you got..
My friends give me bottles of Single Malts
Re: Can any one solve this [message #290269 is a reply to message #289603] Fri, 28 December 2007 04:26 Go to previous messageGo to next message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member

1  2  3  4  5

16 17 18 19 6

15 24 25 20 7

14 23 22 21 8

13 12 11 10 9 


Anyway looks interesting . What about starting One more new Forum / Thread for Puzzles ? Rolling Eyes Rolling Eyes Rolling Eyes

Thumbs Up
Rajuvan.

[Updated on: Fri, 28 December 2007 04:27]

Report message to a moderator

Re: Can any one solve this [message #290288 is a reply to message #290269] Fri, 28 December 2007 05:02 Go to previous messageGo to next message
Michel Cadot
Messages: 64131
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Interested to what? There is no puzzle here unless OP explains his output.
(yes, I saw the helix but this is just a guess, maybe it is just accident until OP states it.)

I vote for a SQL puzzles forum more than a simple topic that will mix up the questions.

Regards
Michel
Re: Can any one solve this [message #290309 is a reply to message #289603] Fri, 28 December 2007 05:58 Go to previous messageGo to next message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member

I dont think it is just accident as OP's first query's output is not accidentially keeping a harmony .

I have put a poll for new Puzzle Forum in Orafaq .

Michel , I need atleast your vote Smile


Thumbs Up
Rajuvan
Re: Can any one solve this [message #290338 is a reply to message #290309] Fri, 28 December 2007 07:05 Go to previous messageGo to next message
Michel Cadot
Messages: 64131
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Vote granted.

Regards
Michel
Re: Can any one solve this [message #290340 is a reply to message #290338] Fri, 28 December 2007 07:16 Go to previous message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member

Thanks Michel Smile

Thumbs Up
Rajuvan.

[Updated on: Fri, 28 December 2007 07:16]

Report message to a moderator

Previous Topic: If I use Put_Line Then program get's compiled but o/p is not shown.
Next Topic: Reverse the order of column
Goto Forum:
  


Current Time: Wed Dec 07 14:32:26 CST 2016

Total time taken to generate the page: 0.07264 seconds