Solved

How do I create query in Oracle that works in SQL Server

Posted on 2013-02-07
3
255 Views
Last Modified: 2013-02-07
Hi Experts,

When working in SQL server I quite often write something along the lines of

SELECT LastName, * FROM Table...

This helps when I am doing some initial investigation and the 'LastName' field is of particular interest to me, but I also want to see the rest of the record.  It stops me from having to scroll through the rest of the record to see 'LastName'.

Now I'm working on Oracle, and that syntax returns an error of "Missing Expression".

What is the correct syntax to accomplish this in Oracle ?
0
Comment
Question by:Steve5140
  • 2
3 Comments
 
LVL 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 total points
ID: 38864417
You need to provide the table name or alias for the '*'.

Try something like:

SELECT LastName, table.* FROM Table...
0
 

Author Closing Comment

by:Steve5140
ID: 38864437
You are correct, that worked just fine.  I probably should have been able to figure that out but I just didn't see it.
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 38864462
lol...

You might be surprised how obscure that is!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Export BLOB data from Oracle 10g 4 35
Convert Oracle data into XML document 2 59
C# Connection String for Oracle database is not working 22 92
Oracle - SQL Parse String 5 19
Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
Via a live example, show how to take different types of Oracle backups using RMAN.

920 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now