473,382 Members | 1,313 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,382 software developers and data experts.

mysql problem with UNION

RP
Hello All,

I have a strange problem with a UNION of 3 queries. The 3 separate
select-queries return (at this point) respectively 4, 3 an zero rows,
but the UNION returns no rows at all.
When I take the query that returns 0 rows, and put it in front of the
other two, everything to go fine (I get 7 rows), but this is of course
no real solution, next time another query returns zero rows.

Anyone a solution or workaround? (I use mysql 4.1.1, tries both InnoDB
and myIsam).

TIA
RP


Jul 20 '05 #1
2 1844
RP wrote:
I have a strange problem with a UNION of 3 queries. The 3 separate
select-queries return (at this point) respectively 4, 3 an zero rows,
but the UNION returns no rows at all.


Did you try UNION ALL?

Bill K.
Jul 20 '05 #2
RP
Bill Karwin stuurde mij op 15-10-2004 23:21 het volgende bericht:
RP wrote:
I have a strange problem with a UNION of 3 queries. The 3 separate
select-queries return (at this point) respectively 4, 3 an zero rows,
but the UNION returns no rows at all.

Did you try UNION ALL?

Bill K.

Thanks,

No I have not, and will try next monday.

RP
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: ++Captain Tripps++ | last post by:
I am trying to run a fuultext search on two identical tables and use UNION to join the results but no matter what I try, I get a syntax error on the UNION clause. Here's the query: (SELECT...
4
by: LRW | last post by:
I have a table in a mySQL database that has 56 fields: 01, 02, 03, 04, etc up to 56. Each field has only 1 record in it. They get changed, updated, constantly, but always remaining one record. ...
4
by: Hal Halloway | last post by:
can mysql work in Windows but not Solaris? Is there any reason you can see why the fulltext php/mysql code below works OK on my win2k php4.3.6. mysql 4.1.3 pc but does *not* work when put on a...
1
by: Bob Bedford | last post by:
I've no access to mysql NG, so I ask here: I've two identical tables (wich are created by usins the same script, but must be separated). When I execute a query wich return fields and do a...
0
by: Lenz Grimmer | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, MySQL 4.0.14, a new version of the popular Open Source/Free Software Database, has been released. It is now available in source and binary...
0
by: Neculai Macarie | last post by:
Hi! Using Union and Order By gives strange behaviour in the following test-case: drop table if exists gallery; drop table if exists gallery_categ; # create test tables create table gallery...
3
by: Noozer | last post by:
Trying to get the following SQL to execute in MySQL 4.0... SELECT DISTINCT CategoryID, tblCategory.Category FROM tblCategory AS A INNER JOIN (SELECT Cat FROM ( SELECT tblCategory.Category AS Cat...
7
by: Daz | last post by:
Hi. I am trying to select data from two separate MySQL tables, where I cannot use join, but when I put the two select queries into a single query, I get an error telling me to check my syntax. Both...
4
by: Andrew S | last post by:
Hello Mr. Expert: - I have 3 tables in mysql in MyISAM table format, I am using mysql4.0 on freebsd5.3 - producttbl, productdetailentbl, pricetblN - they all have "productid" as the Primary KEY....
5
by: inexion | last post by:
Hello, I'll try to explain what I'm trying to accomplish here, hopefully not too bad a task. Basically I have an existing table with data that will be operated on to form new records etc... ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...

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.