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

  • SEARCH
  • Home
  • 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 8828679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:39:44+00:00 2026-06-14T07:39:44+00:00

statement 1: create table tmp as select code , round((max(close)-min(close))/min(close),2) as volatility, case when

  • 0

statement 1:

create table tmp as  select code  , round((max(close)-min(close))/min(close),2) as volatility,
    case  when  (max(close)-min(close))/min(close) <0.1  then  "grade1" 
    when  (max(close)-min(close))/min(close)       <0.2  then  "grade2"
    when  (max(close)-min(close))/min(close)       <0.3  then  "grade3"
    else "grade4"  end  as  type
    from  quote  where date between '20120801' and '20121101' and code<'07000'  
    group by code order by volatility ;

statement 2:

select  tmp.code,profile.name, tmp.volatility from tmp,profile where tmp.code=profile.code;

the statement 1 and statement 2 can run ,when i combine the two into one –the statement 3,
it can’t run ,what is the matter?

statement 3:

 select quote.code ,profile.name, round((max(quote.close)-min(quote.close))/min(quote.close),2) as quote.volatility,
    case  when  (max(quote.close)-min(quote.close))/min(quote.close) <0.1  then  "grade1" 
    when  (max(quote.close)-min(quote.close))/min(quote.close)       <0.2  then  "grade2"
    when  (max(quote.close)-min(quote.close))/min(quote.close)       <0.3  then  "grade3"
    else "grade4"  end  as  quote.type
    from  quote,profile where quote.date between '20120801' and '20121101' and quote.code<'07000' and quote.code=profile.code
    group by quote.code order by quote.volatility ;
  • 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-06-14T07:39:45+00:00Added an answer on June 14, 2026 at 7:39 am

    Just make your first statement a subquery:

    select tmp.code, profile.name, tmp.volatility
    from (select code,
                 round(...) as volatility,
                 case ... end as type
          from quote
          where date between '20120801' and '20121101'
            and code<'07000'
          group by code
          order by volatility) as tmp,
         profile
    where tmp.code = profile.code;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a statement as follows: SELECT * FROM table WHERE
I executing this statement: CREATE TABLE test_mod SELECT * FROM `test` This copied a
So here's some code: statement.executeUpdate(CREATE TABLE SomeTable(id INTEGER IDENTITY, + text CLOB)); which throws
I'm trying to create a new MySQL from a SELECT statement: CREATE TABLE site_database
I know the statement: create table xyz_new as select * from xyz; Which copies
in mysql i can create a table named select using the following statement CREATE
I have this sql statement: CREATE TABLE [dbo].[User]( [UserId] [int] IDENTITY(1,1) NOT NULL, [FirstName]
I used the following create statement: CREATE TABLE `subscr` ( `id` int(11) NOT NULL
The following CREATE TABLE statement to partition a table works as expected, without error.
I was wondering if data types in a a literal create table statement, executed

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.