473,385 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How can I get the full results from this mysql query?

1
This query gives me the data that contains the values specified in the query based on counts.

Expand|Select|Wrap|Line Numbers
  1. SELECT id
  2.      , GROUP_CONCAT(tmp ORDER BY tmp) tmps
  3.   FROM 
  4.      ( SELECT id,tmp1 tmp FROM tmptb
  5.        UNION
  6.        SELECT id,tmp2 tmp FROM tmptb
  7.        UNION
  8.        SELECT id,tmp3 tmp FROM tmptb
  9.        UNION
  10.        SELECT id,tmp4 tmp FROM tmptb
  11.      ) x
  12.  WHERE tmp IN (28,53,65)   
  13.  GROUP 
  14.     BY id 
  15. HAVING COUNT(*) >= 2;
The problem is that it only gives the id, and the specified values (if at least two of them present in the concatenated rows). How can I change it so that it displays the concatenated rows that contains the specified values (at least 2 of them)? please. thank you.
Jul 10 '19 #1
0 1097

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: joemyre | last post by:
Hi everyone, What I'm trying to do is take php variables i got from user input, and pass them as the MySQL query terms. $query = "select * from ident where ".$searchtype1."=".$searchterm1."";...
2
by: JDJones | last post by:
Using PHP and MySQL. Trying to put a list of categories into a drop down select option of a form like: <form name="form" action="<? print $_SERVER?>" method="get"> <select name="subject">...
1
by: nao | last post by:
Hi all! I am aware that this question might involve Javascript and MySQL. So far I haven´t found a suitable solution in JavaScript ng´s - maybe becauese php-programmers are more likely to come...
0
by: taras.di | last post by:
Hi everyone, I've come across an extremely strange problem. The exact same query in both mysql command line client, and mysql query browser gives entirely different results. I was hoping someone...
1
by: joyser | last post by:
hi, just a quick question, what code would you use to show results from a databseit would be great if you could show how to run the query to select and then display thanks!
6
by: traineeirishprogrammer | last post by:
I am currently working on a project where I need to sort my MYSQL query results by different categories. How ever the code does not seem to be working properly and I spend too much time on it...
3
by: Terry | last post by:
Hi folks. I am just starting to dabble in php. I am trying to do some simple pagination in php/mysql. For whatever reason I am only getting the first digit of my result. For example: ...
10
by: Lloyd Harold | last post by:
I'm very new to PHP and attempting to put together a simple script for retrieving MySQL data of personal records. The MySQL table I'm using consists of: 0: id 1: name 2: location (an integer...
1
by: pretzelboy | last post by:
Hi, I last wrote software 13years ago in the pascal, dbase, clipper days. I have recently built a Ubuntu Box and with C++ (and help from the web) setup a serial barcode reader program using Mysql...
5
by: fogsys | last post by:
$result = mysql_query("SELECT * FROM product inner join members ON product_member_id = members_sid WHERE members_username='username'") ; while($row = mysql_fetch_array($result)) { ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.