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 6588921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:06:30+00:00 2026-05-25T17:06:30+00:00

create table1 as SELECT from c.Name, Value, Qtr, Value as SUM(Value) from User.Pofile a,pet_dsa_qtr_table

  • 0
create   table1 as  SELECT  from c.Name, Value, Qtr, Value as SUM(Value) 
from User.Pofile a,pet_dsa_qtr_table b,User.Count c,User.Service  d 
WHERE Category = 'PROFESSIONAL' and Item_Name = 'PROF_PKT_RECVD' and    
convert(char(32),d.User_Id) = c.Name and Service_Name_Cd = 2 
and Status = 2 and d.User_Id *= a.User_Id  and c.Period = b.Period 
and Module = 'ACCT_TRADES' and Type in ('EQ','OPTN')
GROUP BY Name, Item_Value,
Qtr HAVING SUM(Value) >= 10000  and Item_Value in ('0', NULL);

The above was a query that was created by me as an equivalent for sybase.Can anyone help me in correcting this query

  • 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-25T17:06:31+00:00Added an answer on May 25, 2026 at 5:06 pm

    You have some quite serious syntax inconsistencies in your query which I have tried to correct (with guesswork as you haven’t provided a table structure). e.g. In the select list you select “Value” but in the GROUP BY you group on “Item_Value” etc.

    You also need to fully qualify your columns, some you qualify, some (like “Module” and “Type” etc) you don’t.

    You might also want to add a storage clause too.

    Here is my best educated guess at what you are trying to achieve:

    CREATE TABLE table1 
    AS  
    SELECT c.Name, 
           Item_Value, 
           Qtr, 
           SUM(Value) as "SUM_Value"
      FROM User.Pofile a
           pet_dsa_qtr_table b,
           User.Count c,
           User.Service d  
     WHERE Category = 'PROFESSIONAL' 
       AND Item_Name = 'PROF_PKT_RECVD' 
       AND TO_CHAR(d.User_Id) = c.Name 
       AND Service_Name_Cd = 2  
       AND Status = 2 
       AND d.User_Id = a.User_Id(+)  
       AND c.Period = b.Period  
       AND Module = 'ACCT_TRADES' 
       AND Type in ('EQ','OPTN') 
     GROUP BY c.Name, 
              Item_Value, 
              Qtr 
    HAVING (SUM(Value) >= 10000  
       AND NVL(Item_Value, '0') = '0'); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know the statement: create table xyz_new as select * from xyz; Which copies
How to select a same database? I want to create a table from already
I have two tables: CREATE TABLE Table1 ( ID VARCHAR(15), Value INT ); INSERT
I am trying to create a name,value pair in Hibernate which gets returned as
I have created a Temporal Table: create table #T_Table(id int,name nvarchar(80),value float); I am
If I have two tables such as this: CREATE TABLE #table1 (id INT, name
I am using this SELECT name FROM sqlite_master WHERE type = table AND name
create table foo (id, name varchar(255), value varchar(255)); Does it make sense to index
create table foo (id, name varchar(255)); create table foo_values (id, foo_id, name varchar(255), value
Here is my table in the dataset: SELECT tag_work_field.* FROM tag_work_field I created this

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.