?
Solved

MS SQL to Oracle

Posted on 2011-05-04
2
Medium Priority
?
388 Views
Last Modified: 2013-11-11
Hi,
I have the following sql statement in my program.
sql =  “SELECT  null as ID, '- Select Team -' as Team Union Select ID, Team from Team where ID in(2,3,4) order by Team”
I am trying to make it to work in Oracle but with no luck.  Please advice.  Thanks!
        ID        Team           (this is an output in MS SQL)
1     null      - Select Team -
2      1         TeamA
3      2         TeamB
0
Comment
Question by:avi7
2 Comments
 
LVL 78

Accepted Solution

by:
slightwv (䄆 Netminder) earned 1000 total points
ID: 35691942
try this:
select id, team from (SELECT  null as ID, '- Select Team -' as Team from dual Union Select ID, Team from Team where ID in(2,3,4)) order by Team
0
 

Author Closing Comment

by:avi7
ID: 35692505
Thanks!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Suggested Courses
Course of the Month13 days, 9 hours left to enroll

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question