Home » SQL & PL/SQL » SQL & PL/SQL » Need help to build a query (Oracle12C)
Need help to build a query [message #689470] Wed, 17 January 2024 10:16 Go to next message
shabir46
Messages: 41
Registered: November 2009
Member
Hello,

Table Name : TAB
doc date        ond seq
123 01-Jan-23 DXB-*** 1
123 02-Jan-23 DXB-*** 1
123 03-Jan-23 ***-SYD 2
123 04-Jan-23 SYD-ADL 3
123 05-Jan-23 ADL-DXB 4
123 06-Jan-23 ADL-DXB 4
123 07-Jan-23 DXB-*** 5
123 08-Jan-23 DXB-*** 5

Question:
There is a table called TAB with 3 columns- doc,date and ond as shown above. I need to generate a column namely seq based on the column ond ordering with date column

Can you help me in writing a query



Re: Need help to build a query [message #689472 is a reply to message #689470] Wed, 17 January 2024 12:12 Go to previous message
Michel Cadot
Messages: 68658
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

From some of your previous topics:


BlackSwan wrote on Wed, 09 February 2011 06:05
It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/...

Michel Cadot wrote on Sat, 19 February 2011 08:08
From your 3 previous topics (without quoting the previous ones):


BlackSwan wrote on Wed, 09 February 2011 06:05
It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/

The Posting Guidelines state that we don't do homework assignments.

Michel Cadot wrote on Thu, 18 November 2010 18:04
Please format your post using [code][/code] and [pre][/pre] and align the columns in the result.
Read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Use the "Preview Message" button to verify.
Also always post your Oracle version, with 4 decimals.

Michel Cadot wrote on Mon, 27 December 2010 16:09
Thanks for the test case but could you please code tags to format your post (as I did it). If you don't know how, please, read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version, with 4 decimals.
I'm tired to repeat the same thing, you have no respect towards those who help you again and again, from now I will help you when you'll post a formated question. It is really not difficult to do it, just try it and you will see you can do it, I am confident you can do it. If you can't tell us, we will give you some advices.
...

BlackSwan wrote on Tue, 24 May 2011 17:20
It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/

cookiemonster wrote on Thu, 08 September 2011 12:56
1) Please read and follow How to use [code] tags and make your code easier to read?
2) You're just making it up.
SQL> SELECT case when REGEXP_COUNT('123333456', '6', 1, 'i') >2 then 
  2  'yes' else 'no' end
  3  FROM DUAL;

CASEWHENREGEXP_COUNT('123333456'
--------------------------------
no

SQL> 
Test your solutions before posting them.
BlackSwan wrote on Mon, 06 August 2012 00:56
Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/

With any SQL or PL/SQL question, please, post a working Test case: create table (including all constraints) and insert statements along with the result you want with these data then we will be able work with your table and data. Explain with words and sentences the rules that lead to this result.

In addition, you did NEVER feed back and thank people for the help they provided and time they spent for you.

[Updated on: Wed, 17 January 2024 12:14]

Report message to a moderator

Previous Topic: XML Create logic
Next Topic: VSIZE() function's meaning and physical storage size
Goto Forum:
  


Current Time: Mon May 27 00:49:19 CDT 2024