473,508 Members | 4,324 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

A SQL query on the existence of columns in two tables

22 New Member
Hi,

A SQL query on the existence of columns in two tables. For example, tables A and B have many columns, respectively, such as COLA1, COLA2, COLAM, and COLB1, COLB2, COLBN. I wish to write a SQL query to check whether Table C's columns (COLC1, COLC2, COLCL) exist in Table A and B. If possible, I prefer not to answer the question with the information_schema.columns, but use the joins/subqueries between A and B.

Thanks in advance!

-CUQ
Apr 18 '12 #1
2 1305
r035198x
13,262 MVP
You can't do it with joins on A and B because you don't know which columns to do the joins on.information_schema is best for this. Why don't you want to use it?
Apr 18 '12 #2
cuqsy0
22 New Member
@r035198x
Thank you for the advice. How can I do it with information_schema ?
Apr 18 '12 #3

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

Similar topics

7
10173
by: Jay | last post by:
Hi everyone ! I hope someone will be able to help me with this problem. I currently have several tables in MySQL database. Below is my table structures. (Data type for each fields are...
1
7371
by: Nikola Pecigos | last post by:
Hi, I have the following problem: We have an Oracle 9.2 with one table "document" which contains a path to the filesystem. If I want to index these files (HTML, PDF, World, Excel, etc.), I...
8
3360
by: Rigga | last post by:
Hi, I am new to mysql and need help on how to join tables. I have a database which contains 4 tables, the main table contains information by date order and the other 3 contain data also in date...
2
4255
by: Steve | last post by:
Hi, Have a database that contains various tables. I need to run a query on two tables. Table A contains a column called Titles Table B contains a column called Uni_Titles
1
1690
by: Carl B Davis | last post by:
Help please!!! I am an intermediate access user that is getting my bottom kicked by what seems an easy problem to fix. I maintain an employee database at work. I have set up a query from two tables...
1
1936
by: Ike | last post by:
I have a simple query of joined tables that is failing to give me any rows of data (though, in checking by hand, it certainly should). Essentially, I am trying to return all rows from `ups` that...
1
1397
by: Fendi Baba | last post by:
I need to perform a query against 3 tables, All the tables contain the fields, name and position and have the same foreig key which is project ID How can I do this and present this in a view? ...
1
1377
by: Alex Chun | last post by:
How can I make a Query that combines tables, so that if table1 has records "apples", "pears" and table2 has records "apples", "cherries", the query result will be "apples", "pears", "cherries"? ...
7
1681
by: cov | last post by:
I have a php query where I'm attempting to pull data from 3 different tables between a php form and mysql db. I had hoped early on to use a unique identifier to help ensure referential integrity...
1
2330
by: rsmlmlb | last post by:
I need to create a query from 3 tables (client, work and accts recv). The client table has the unique id. The work table has wrkdte and the accounts receiveable has ardte. How can I pull the work...
0
7228
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,...
0
7128
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
7332
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
7393
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...
0
5635
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5057
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...
0
3206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1565
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 ...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.