October 19, 2010 at 1:30 am
I would like to take 2 tables and join them
both tables are exactly the same except for the file name
ie stochist and stoctran
i want a file that will have both current and histoy data in them
many thanks
Larry
October 19, 2010 at 4:12 am
Hi,
Can you share more info.
Regards,
Prajey
October 19, 2010 at 5:11 am
Larry,
Going to need a lot more information here, see the 'How to post...' link in my sig below for some help.
October 19, 2010 at 5:46 am
Both tables have exactly the same fields but different record data and tried this!!
select * from stoctran
union all
select * from stochist
but does not give me all the data from both tables ???
I am using a DB manager program to do the SQL script and allows me to save the data created into a file.
eg stoctran.dat
code description txdate qnty price
xyz widget 10/5/01 10 34.60
xyz widget 15/5/01 5 34.60
abc icon 16/5/01 9 10.50
stochist.dat
code description txdate qnty price
xyz widget 10/5/98 7 32.60
xyz widget 15/5/99 5 33.60
abc icon 10/01/01 4 9.50
what result I want is
code description txdate qnty price
xyz widget 10/5/01 10 34.60
xyz widget 15/5/01 5 34.60
abc icon 16/5/01 9 10.50
xyz widget 10/5/98 7 32.60
xyz widget 15/5/99 5 33.60
abc icon 10/01/01 4 9.50
October 19, 2010 at 5:52 am
Don't see why that wouldn't give you all records from both tables, that's exactly what 'UNION ALL' does.
What makes you think is not returning all records ?
Can you do a COUNT on the individual tables and compare the totals to the total number of records in the union?
October 19, 2010 at 5:59 am
hi Nigel
thats the bitch... stochist has about 15,000 records and stoctran has about 400
but all that is being returned is 35 records and cannot understand why.
tables are not corrupted.
The database is DBIsam and using dbsys.exe manager from elevate software.
to be honest very much a newbie with SQL and do not work much with it.
October 19, 2010 at 6:09 am
Ah, not SQL Server then. Your best bet then is the elevate software website.
October 19, 2010 at 6:18 am
their website sucks and also an old version of the software that is no longer supported but SQL is still SQL, just the syntax is different between different vendors.
any how will battle on
thanks for taking the time to respond
October 19, 2010 at 6:36 am
Larry Coe (10/19/2010)
their website sucks
Ahh! typical. Sorry I couldn't be of more help.
As you say SQL is SQL (maybe!). 🙂
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply