Link to home
Start Free TrialLog in
Avatar of K Feening
K FeeningFlag for Australia

asked on

VB.net SQL

I have 3 Tables -   Accounts, Stock, Customers
Accounts - Fields
Invoice,Name,Edited

Stock - fields
Stocknumber, name, edited

Customers - fields
Customerno, name, edited

I want to run a sql to create a table all String fields to have
Field1,field2,field3,Field4

accounts then
field1 = ‘A’,field2 = Invoice, Field3 = Name, Field4 = edited

Stock then
field1 = ‘S’,field2 = Stockno, Field3 = Name, Field4 = edited

Customers then
field1 = ‘C’,field2 = CustomerNo, Field3 = Name, Field4 = edited

something like
Select
‘A’ as Field1 (if stock then Field1 = 'S')
,a.Invoice as Field1
,a.Name as Field2
a.Edited as Field3
from Accounts as a
then how do you add the other table data without losing the accounts data
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of K Feening

ASKER

Thanks hadn't used Union before
excellent