473,778 Members | 1,958 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

distinct field from two similar tables

Hi Friends,

I am kinda stuck with a SQL query, can some one please guide me?

I have two 'similar' tables
a) open_works_tabl e
b) closed_works_ta ble
now, closed_works_ta ble have 2 extra fields compared with
open_works_tabl e all other fields are same(name and type).

The reason for two similar tables is because open works is quite used
and contain only few rows compared to the huge number of closed
works(rarely used).

I want to get the DISTINCT list of all job_types(a field in both
table) from the two tables. How to get it? these two tables are not
related, just similar. I think, I can just pass a query
SELECT DISTINCT(job_ty pe)
FROM {concatenated openworkstable and closedworks table}

But how to join two tables one below the other? or is there is some
other solution?

TIA
Vijoy
Jul 19 '05 #1
0 2063

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

Similar topics

9
6148
by: Dave M | last post by:
All I've got a database that keeps track of sales of widgets. Each company that belongs to my organiztion is to report their widget sales or no sales every month. There are several different types of widgets. Not all companies sell or report all types of widgets. We want to report how many companies have reported or not reported their
0
605
by: Vijoy Varghese | last post by:
Hi Friends, I am kinda stuck with a SQL query, can some one please guide me? I have two 'similar' tables a) open_works_table b) closed_works_table now, closed_works_table have 2 extra fields compared with open_works_table all other fields are same(name and type).
2
2787
by: Maziar Aflatoun | last post by:
Hi everyone, I have 2 tables with table A containing an 'email' field and table B containing 2 fields 'primaryemail' and 'secondaryemail'. Now is it possible to issue a query that would return only the unqiue email addresses in these 3 fields? So a long list with no duplicate emails(distinct). Thank you Maz.
2
12548
by: mfyahya | last post by:
I have two tables, both containing an 'authors' column. Is there a way to get a unique list of authors from the two tables? I tried SELECT DISTINCT `authors` from `table1`, `table2`; but I got an "Column 'authors' in field list is ambiguous" error. Is there also a query to return only the count of distinct authors from the two tables? Thanks for any help.
5
53474
by: Fred Zuckerman | last post by:
Can someone explain the difference between these 2 queries? "Select Distinct id, account, lastname, firstname from table1" and "Select DistinctRow id, account, lastname, firstname from table1" Thanks, Fred Zuckerman
6
4693
by: dick | last post by:
Am working with MS Access 2003 & tables downloaded from Oracle. Am not a GURU, more of a hacker, but have done a bit of everything in many languages/programs/etc. I have data fields in 2 tables that I want, and these are linked by 2 intermediary tables, say tblA, tblB, tblC, & tblD. The fields I want are in A & D, B & C contain the linking fields. I put this together in Access Design view, made the links, and it sort of works. But, I...
2
5375
by: Genalube | last post by:
I am running a query that includes the inclusion of memo fields, my query pulls from four different tables with one to many relationships between them. The relationships are such that when I run my query I get several identical records. I thought I could just put the DISTINCT keyword in and solve this problem. It does but the 255 character limitation that crops up with memo fields, rears its head and cuts out large chunks of the memo field....
4
30009
by: Lacutas | last post by:
Hi all, I am having some problems using LINQ to access Distinct records from a Dataset. I have looked around and believe it should be as simple as added .Distinct() to my LINQ query below, though intellisense doesn't even give that option! My DataSet has multiple tables, all populated with data. I have a table called DemographicCriteria which has the fields listed below. CriteriaID DemographicCode InputID
1
2674
by: ggfota | last post by:
Hi I have a problem with SELECT DISTINCT query. I'm trying to solve why it causes error 3464. Guess that problem might be cause by one field. The source table has text(17) field from which I need to extract 'YYMMDD' date and convert it to date/time format. I convert only from not null and 17char strings I use following function in SQL statement
0
9470
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10298
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...
0
10127
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10069
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
9923
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
7475
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
5500
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4033
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2865
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.