473,785 Members | 2,424 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unable select all columns from 2 tables using Union all...

1 New Member
Hi All,

The below query works well, but I'm unable to select * columns or selected columns from 2 tables.


select FIAS_ID, ACTION_ID from CTH_ABAL_FIAS_H ISTORY
where ACTION_ID = 535 OR ACTION_ID = 536
union all
select FIAS_ID, ACTION_ID from CTH_ABAL_FIAS_D EPTH_HIST;

Please give me a solutions...

Thanks.
Mar 8 '11 #1
2 2659
Rabbit
12,516 Recognized Expert Moderator MVP
A union query has to have the exact same number of columns in all the queries.
Mar 8 '11 #2
debasisdas
8,127 Recognized Expert Expert
and the data types of the columns should match .
Mar 9 '11 #3

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

Similar topics

4
7612
by: jonnychang | last post by:
What is the purpose of using union in this class? Class A { public: union { int age; char * name; double amount; } };
1
2271
by: Gerald Maher | last post by:
Hi I need to select 2 tables . The field 'p_description' is not always aviable but i still need to print it to the screen SELECT * FROM task,p_description WHERE ComponentIDLink = 34 OR task.TaskID = p_description.pTaskLink GROUP BY TaskID ORDER BY TaskName
3
4618
by: Rich Protzel | last post by:
Hello, So my table contains say 100,000 records, and I need to group the categories in fld1 by the highest count of subcategories. Say fld1 contains categories A, B, C, D, E. All of these categories contain subcategories AA, AB, AC, AD,...AJ, BA, BB...BJ, CA, CB, CC...CJ, etc in fld2. I am counting how many subcategories are listed for each category. Like
1
1845
by: donhyams | last post by:
It seems like at one time I knew how to do this, but right now I'm drawing a blank. I know there has to be an easier way to link tables using more than one field. Heres a simplfication of the problem: I have two tables that are not normally linked to each other: ------------ tblClientStatusDetails with these fields: ...ClientStatusID = Autonumber (Primary Key)
12
2915
by: Susan Bricker | last post by:
For those of you who have been following my posts - they all pertain to a Dog Competition Organization's Database. There are three classes that the dogs can participate: NOVICE, OPEN, and UTILITY. I want to produce a report of the top 10 average scores for each class for each year.
9
11383
by: imtmub | last post by:
Hi, I have three tables its contains same kind of fields for different time periods. For the result i want to link the tables. can u tell me some examples.
1
1973
by: new214 | last post by:
Hey all, got abit of a problem. Ive got a database where ive got 2 tables. I want to create a command which selects * from table 1 and if the same values are in table2 - it updates otherwise adds. Ive got a loop so i can run through the data records But i dont know how i check 1 objrs against another within an sql statement?? please look at coding example below: Im calling my data from the 2 tables using select commands- which is ok.- uses...
6
2584
by: steve.kim | last post by:
Hello, I'm trying to make a class like below... class myClass { public: // ctor / dtor .... // methods
1
2987
by: wizardRahl | last post by:
Hello, I'm curious to know if there is a way to select all tables when using a query in access. I have some (unsuccessful) cascading combo boxes and need a little help maybe working out the query. I am familiar with database concepts, but am new to Access. The problem is in the query statement. I'm not sure what to put after FROM because it would depend on the user's entry. I would need it to look something like this, but my...
1
1199
by: abhishek1234321 | last post by:
I there any way to select tables using wildcards? like for example i have 100 tables in my database with names "1rn08cs001" "1rn08cs002"... etc now i want a wild card method to select oly the tables from 1rn08cs001 to 1rn08cs005 is this the right way mysql_query("SELECT * FROM REGXP 'some regular expression'"
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10356
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9958
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7506
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5523
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3662
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2890
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.