Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2013-02-07
3
Medium Priority
?
263 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 2000 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 77

Expert Comment

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

You might be surprised how obscure that is!
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
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
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

598 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