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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:39:33+00:00 2026-06-18T00:39:33+00:00

i have the table with variable version with modalities V1, V2, V3, V4 and

  • 0

i have the table with variable version with modalities V1, V2, V3, V4 and the other variable call, it can be 1 or 0. what i need to do is to calculate the frequency of 1 to the total number of lines for each modality of version: for ex for V1 i have 6 lines with call equal to 1 and 13 lines in global, i need to create variable freq which will indicate 6/13.
what i do for now is i create 2 table: first one with number of lines with call equal 1 for each

version Version Call=1 
             V1      6
             V2      4
             V3      8
             V4      3

and the second table with total number of lines of each version

   Version Call total
     V1      13
     V2      14
     V3      15
     V4      23

Then i join this 2 tables and calculate the frequency.
i wanted to ask if there is no another way to do this?

this is my code:

create table Call1 select *, count(*) as call1 from Version where call like '1'group by Version;
create table Calltotal select *, count(*) as calltot from Version group by Version;
update Calltotal change Version Version1 VARCHAR(2);
alter table Call1 add index (Version);
alter table Calltot add index(Version1);
create table final select * from Call1 left join Calltot on Call1.version=Calltot.version1;
alter table final add frequency INT NOT NULL;
update final set frequency=call1/Calltot;
  • 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-18T00:39:34+00:00Added an answer on June 18, 2026 at 12:39 am

    A pointer…

    SELECT thing
         , COUNT(CASE WHEN other_thing = 10 THEN 'foo' END) x 
         , COUNT(*) y  
      FROM my_table 
     GROUP 
        BY thing;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table (table variable in-fact) that holds several thousand (50k approx) rows
I have the following table variable in SQL Server 2005: DECLARE @results TABLE (id
I have defined a table type PL/SQL variable and added some data there. create
I have a classified_id variable which matches one document in a MySql table. I
I have two tables (using table variables for illustration. You can run these directly
I have to call the table() function on 10 variables in R. Is there
I have a form with a variable number of inputs. The inputs are inside
I have a MyDBAdapter class, that can do selects, but I also need to
i have a temp table . The number of column and name of column
I have three separate table variables in my Function, 1 of them is not

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.