Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7162225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:41:58+00:00 2026-05-28T13:41:58+00:00

In SQL Server, you can write nested SQL like this: SELECT T.con FROM (SELECT

  • 0

In SQL Server,

you can write nested SQL like this:

SELECT T.con
FROM (SELECT count(*) as "con" FROM EMP) AS T

In such way, I can get a temp table T that can be nested into other query.

But I cannot do the same thing in oracle SQL

It gives me ORA-01747:invalid column

SELECT *
FROM (SELECT count(*) as "con" FROM EMP) T

select * works, but it’s not what I want. Anybody knows how to do it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T13:41:59+00:00Added an answer on May 28, 2026 at 1:41 pm

    The query you posted works fine for me whether I specify the alias explicitly or whether I specify a *. Can you post the exact query you’re running when you get the exception?

    SQL> SELECT *
      2  FROM (SELECT count(*) as "con" FROM EMP) T;
    
           con
    ----------
            14
    
    SQL> ed
    Wrote file afiedt.buf
    
      1  SELECT "con"
      2* FROM (SELECT count(*) as "con" FROM EMP) T
    SQL> /
    
           con
    ----------
            14
    

    My guess would be that you’re trying to select con without the double-quotes. If you use a double-quoted identifier in Oracle, you’re telling Oracle that you want the identifier to be case-sensitive which, in turns, means that you always have to refer to it in a case-sensitive manner and you have to enclose the column name in double quotes every time. I would strongly advise against using case sensitive identifiers in Oracle.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in SQL Server, if I have an int variable, how can I write a
How would one write a sql server DDL script that can: For each table
I am trying to write a query for SQL Server 2005 but I can't
SQL Server procedure can return result sets. I have a table emp(emp__id, emp__name, ...)
In SQL server you can use the DATENAME function to get the day of
I have this sql: UPDATE JOBMAKE SET WIP_STATUS='10sched1' WHERE JBT_TYPE IN (SELECT JBT_TYPE FROM
In SQL server you can write create index indx on T1 (A,B) INCLUDE (C,D,E)
Does any one know how can I write a SQL Server script to check
As we can write in SQL to return single static value select Jan as
In SQL Server we can write data AS Numeric(15,10) .. what will the equivalent

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.