Home » SQL & PL/SQL » SQL & PL/SQL » Unique record in Datablock (oracle forms,6i,xp)
Unique record in Datablock [message #350619] Thu, 25 September 2008 10:57 Go to next message
yoonus.it@gmail.com
Messages: 109
Registered: June 2007
Location: kuwait
Senior Member
Hi,

Is there a way to restrict datablock to fetch only distinct values?

Thank You
uns
Re: Unique record in Datablock [message #350623 is a reply to message #350619] Thu, 25 September 2008 11:00 Go to previous messageGo to next message
Michel Cadot
Messages: 64140
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Explain your question.

Regards
Michel
Re: Unique record in Datablock [message #350648 is a reply to message #350623] Thu, 25 September 2008 15:05 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Looks like a Forms question to me ...

One way would be to create a view as
SELECT DISTINCT column_list_here
FROM this_table
WHERE possible_condition(s)
and base data block on this view (instead of a table).

Or, you might create a FROM CLAUSE data block (which would do the same as previous solution (more or less), as you'd also need to use DISTINCT keyword.
Re: Unique record in Datablock [message #350690 is a reply to message #350623] Thu, 25 September 2008 22:47 Go to previous messageGo to next message
yoonus.it@gmail.com
Messages: 109
Registered: June 2007
Location: kuwait
Senior Member
I have a table with following data


Dat                id            name
24-sep-2008        1             a
24-sep-2008        2             b
25-sep-2008        3             c
25-sep-2008        4             d



I want fetch only unique dat feild .

ex:
the result of the query im only expecting

24-sep-2008
25-sep-2008

Re: Unique record in Datablock [message #350720 is a reply to message #350690] Fri, 26 September 2008 00:55 Go to previous messageGo to next message
Michel Cadot
Messages: 64140
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
select unique dat from mytable;


Regards
Michel
Re: Unique record in Datablock [message #350723 is a reply to message #350619] Fri, 26 September 2008 00:58 Go to previous messageGo to next message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member

Quote:
Is there a way to restrict datablock to fetch only distinct values?


Answer is there in your question itself


Thumbs Up
Rajuvan.

[Updated on: Fri, 26 September 2008 00:58]

Report message to a moderator

Re: Unique record in Datablock [message #350777 is a reply to message #350723] Fri, 26 September 2008 05:36 Go to previous messageGo to next message
yoonus.it@gmail.com
Messages: 109
Registered: June 2007
Location: kuwait
Senior Member
Oracle confused me for sometime with distinct command. However i tried to use distinct command on this column. It was giving me duplicate for one date. I wasted a lot of time on that. After all i just deleted all the rows of that table and inserted new records then it was working noramlly..Sorry to take your time Sad
Re: Unique record in Datablock [message #350780 is a reply to message #350777] Fri, 26 September 2008 05:49 Go to previous message
Michel Cadot
Messages: 64140
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Oracle date datatype also contains time.
You have not duplicates you just have date values with different times but you did see it because you only display date part (and don't display time part).

Regards
Michel
Previous Topic: db2 link from oracle
Next Topic: commit required for grant ?
Goto Forum:
  


Current Time: Fri Dec 09 09:56:50 CST 2016

Total time taken to generate the page: 0.05450 seconds