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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:40:48+00:00 2026-06-17T07:40:48+00:00

Im trying to use a variable to count the number of rows i have

  • 0

Im trying to use a variable to count the number of rows i have for a specific id, if i use it without inner joins it works perfectly, otherwise no, here is the section without joins

    select
                            cd.basis_point bpt,
                            cd.created,
                            @version:=@version+1 version
                        from tbl_class_det cd, (select @version:=1) v
                        where (cd.class_uuid='{$row['uuid']}')
                        and (cd.created>(
                                                        select
                                                            created
                                                        from tbl_class_det
                                                        where (class_uuid=cd.class_uuid)
                                                        order by created asc
                                                        limit 1
                                                    ))
                        order by cd.created asc

the section with joins that gives an error:

    select c.name,
                            fd.value bpt,
                            fd.created,
                            @version:=@version+1 version
                        from tbl_fee_det fd, (select @version:=1) v
                            INNER JOIN tbl_fee f ON f.uuid = fd.fee_uuid
                            INNER JOIN tbl_class c ON c.uuid = f.class_uuid
                        where (fd.created>(
                                                        select
                                                            created
                                                        from tbl_class_det
                                                        where (fee_uuid=f.uuid)
                                                        order by created asc
                                                        limit 1
                                                    ))
                        order by fd.created asc;
  • 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-17T07:40:49+00:00Added an answer on June 17, 2026 at 7:40 am

    You are using a combination of explicit and implicit joins. You should not mix the JOIN syntax with the comma syntax. If you need to you this then use a subquery similar to this:

    select name,
        value bpt,
        created,
        @version:=@version+1 version
    from
    (
        select c.name,
            fd.value,
            fd.created,
            f.uuid
        FROM tbl_fee_det fd
        INNER JOIN tbl_fee f 
            ON f.uuid = fd.fee_uuid
        INNER JOIN tbl_class c 
            ON c.uuid = f.class_uuid
    ) f, (select @version:=1) v
    where (created>(select created
                       from tbl_class_det
                       where (fee_uuid=f.uuid)
                       order by created asc
                       limit 1))
    order by created asc;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use WolframAlpha to solve for a variable. I have u(k, r)
I am trying to use variable in different function, I want to set global
I'm trying to use my variable in all files of my program. this is
I am trying to use a variable to get a function in a extended
I am trying to use Unicode variable names in g++, but it does not
I'm a newbie to PHP/SQL and I am trying to use a variable within
I'm trying to use a global variable. I've declared it as global to begin
I am trying to use a C++11 Lambda to initialize a const member variable
I'm trying to use usort() and leverage a global variable inside its function scope,
I am trying to understand how to use instance variable in Perl OO -

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.