General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Select * from 2 tables
Hi all
I am trying to create a cursor with the content of two tables, the first table contains 425 record, the second one 245. When i issue the following SQL statement : SELECT * from Table1 a, Table 2 INTO CURSOR MyCyrsor i get 104125 records (425*245) !!!
The two tables have the same structure. My workaroud is to create a Temporary table add append from the two tables:
USE Table1
MyCode = 1234
TempTable = SYS(2023)+'\'+SYS(2015)
COPY STRU TO (TempTable)
USE (TempTable) Alias Temp
Append From Table1 For Code = MyCode
Append From Table1 For Code = MyCode
There must be an SQL Statement who can do this ?
Thanks
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only