Home » SQL & PL/SQL » SQL & PL/SQL » help for Data display
help for Data display [message #287956] Fri, 14 December 2007 02:08 Go to next message
freakabhi
Messages: 74
Registered: November 2007
Location: mumbai
Member
Hi all...

I need to create a Query which will fetch Data from inline Subquery which will be a static Data.

Or may u gimme some better way for this

To understand my problem please find the attached file

E.g.

from
freakabhi
  • Attachment: ORAFAQ.doc
    (Size: 36.00KB, Downloaded 480 times)
Re: help for Data display [message #287959 is a reply to message #287956] Fri, 14 December 2007 02:31 Go to previous messageGo to next message
Michel Cadot
Messages: 68737
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
If read OraFAQ Forum Guide you see:
- we can't download doc file (due to firewall/proxy restrictions)
- you must not use IM speak

Post in a text file without forgetting a test case (create table and insert statements) and detailed explaination of the resyult want with your test case.

Regards
Michel
Re: help for Data display [message #287963 is a reply to message #287959] Fri, 14 December 2007 02:43 Go to previous messageGo to next message
freakabhi
Messages: 74
Registered: November 2007
Location: mumbai
Member
Sorry I forgot abt it,,,

anyways I have a table SRC_FILE which tracks no of file coming from different sources.this table get updated as per
File comes every day..

Source File_name
A A1.txt
A A2.txt
B B1.txt
B B2.txt
C C1.txt
C C2.txt
D D1.txt
D D2.txt

Say , suppose when there is no file from D, So last two rows will not be there in the tables as....

Source File_name
A A1.txt
A A2.txt
B B1.txt
B B2.txt
C C1.txt
C C2.txt


Now we have to Shows Count of file received from tables per
Source as follows:

Src count
A 02
B 02
C 03
D 00

how to do that...as there is no Data for D...

from
Freakabhi


Data will like


Re: help for Data display [message #287964 is a reply to message #287963] Fri, 14 December 2007 02:44 Go to previous messageGo to next message
Michel Cadot
Messages: 68737
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
How do we know there should be and display a D line and not E or Z one?

Regards
Michel

[Updated on: Fri, 14 December 2007 03:05]

Report message to a moderator

Re: help for Data display [message #287975 is a reply to message #287964] Fri, 14 December 2007 03:19 Go to previous messageGo to next message
freakabhi
Messages: 74
Registered: November 2007
Location: mumbai
Member
good question...

infact we have only 4 sourcs A,B,C and D.....
so
Re: help for Data display [message #287977 is a reply to message #287975] Fri, 14 December 2007 03:25 Go to previous messageGo to next message
Michel Cadot
Messages: 68737
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
You can use a table that contains all the possible sources and outer join with your src_file table.
It can be a permanent table or a subquery like one of the following:
SQL> select 'A' source from dual
  2  union all
  3  select 'B' from dual
  4  union all
  5  select 'C' from dual
  6  union all
  7  select 'D' from dual
  8  /
S
-
A
B
C
D

4 rows selected.

SQL> select chr(ascii('A')+level-1) source from dual connect by level <= 4;
S
-
A
B
C
D

4 rows selected.

Regards
Michel
Re: help for Data display [message #287987 is a reply to message #287977] Fri, 14 December 2007 04:26 Go to previous message
freakabhi
Messages: 74
Registered: November 2007
Location: mumbai
Member
great sir......

that thing worked too well....

thanks for this...Smile


from,
freakabhi
Previous Topic: Count and Rownum calcualtion for a query fetch
Next Topic: create external table
Goto Forum:
  


Current Time: Sat Feb 15 02:19:12 CST 2025