Home » SQL & PL/SQL » SQL & PL/SQL » Question is simple but answer is confusing (oracle)
Question is simple but answer is confusing [message #392916] Thu, 19 March 2009 11:25 Go to next message
rajesh_tns
Messages: 6
Registered: February 2009
Junior Member
I have a table as follows

book_num book_name book_price book_version
1 A 10 1
2 B 20 1
3 C 30 2
4 D 100 4
2 B 20 0

Now i want to create a view with following conditions

1)Reflect all columns in the above table( what ever columns that may be added in future )
2)I should not alter the procedure when a new column is added to the above table in future
3)I want to retrieve all the book_versions = 0 and 1
4)we may get two rows same (when we put the conditon 0 and 1)
ex: book_num 2

in such cases i want to remove book_version 1 coz all other columns are repeating

Re: Question is simple but answer is confusing [message #392918 is a reply to message #392916] Thu, 19 March 2009 11:30 Go to previous message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
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 (See SQL Formatter), use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).

Use SQL*Plus and copy and paste what you already tried.

Regards
Michel
Previous Topic: PL/SQL trigger
Next Topic: Help on Query - analytic?
Goto Forum:
  


Current Time: Wed Dec 07 16:36:42 CST 2016

Total time taken to generate the page: 0.06375 seconds