Paul Edward Pagente Paul Edward Pagente - 1 year ago 83
MySQL Question

How to merge Columns from 2 Different tables?

I have a table in MYSQL that looks like this (Example.)

enter image description here

Only the

Table 1
Table 2
table 3
is the output. My Question is how can make the Table 3 output? I mean combine the 2 tables column because i want to display it in
like this.

enter image description here

I have the code of displaying the data in combobox but my problem is the MySQL command, if you want to here is the code in combobox

Dim mycon As New MySqlConnection("server=localhost;pooling=false;userid=root;password=admin1950;database=inventory")
Dim da As New MySqlDataAdapter("This is where the MYSQL Command", mycon)
Dim dt As New DataTable
ComboBox1.DataSource = dt
ComboBox1.DisplayMember = "Column Name"
ComboBox1.ValueMember = "Column Name"

atleast the merge column would have a column name so i can put it in the DisplayMember and ValueMember.

TYSM for help

Answer Source

Use UNION operator for combining result from more than 1 tables

SELECT column1 FROM table1 
SELECT column1 FROM table2
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download