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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:55:08+00:00 2026-06-01T10:55:08+00:00

What is wrong with my query? SELECT … MATCH(results.keywords) AGAINST(‘.DB::e($_POST[‘s’]).’ IN BOOLEAN MODE) AS

  • 0

What is wrong with my query?

SELECT ...
       MATCH(results.keywords) AGAINST('".DB::e($_POST['s'])."' IN BOOLEAN MODE) AS aaa,
       SUM( MATCH(tags.keywords) AGAINST('".DB::e($_POST['s'])."' IN BOOLEAN MODE) ) AS bbb
  FROM table1
  JOIN table2 ... JOIN table3 ...
 WHERE (aaa > 0   here the alias doesn't work!
        OR bbb > 0   here the alias doesn't work! )
GROUP BY table1.id
ORDER BY aaa DESC,  but here the alias works!
         bbb DESC  but here the alias works!

If I remove the WHERE clause works perfectly… so what is wrong with my aliases?

  • 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-01T10:55:09+00:00Added an answer on June 1, 2026 at 10:55 am

    You need to use HAVING (here and here and somewhat less helpfull: here); the WHERE clause gets evaluated before the aliases even exist 😉

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

Sidebar

Related Questions

The query: select title from gamelist where match (title) against ('super mario luigi'); Returns:
Whats wrong with my query? ALTER TABLE test_posts ADD sticky boolean NOT NULL default
I'm pulling my hair out for this, what is wrong with this query: SELECT
Whats wrong with the following JPA query select count(obj) from User as obj join
What's wrong with this mysql query : select * from tpa as t1 where
So here is the original query SELECT SUM(PickQty), SUM(ReqQty), AssignmentID, StopID FROM PickRequest GROUP
What might be wrong with this query: select count(customer_email) as num_prev from _pj_cust_email_by_date where
I have written the select fallowing query but it is giving different results surprisingly
I have a problem with the following HQL query: select sum(MYTABLE.COUNTER) from ( select
What is wrong with my this code, i think the select query is wrong

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.