Looks like "Left Outer Join" keyword worked in Sybase 12.5.
In Sybase, few Derived tables also worked except when I assign value to variables in SELECT caluse, it gives an error:
"A SELECT statement that assigns a value to a variable must not be combined with data-retrieval operations"
Query within Sybase proc did not work, if I assign value to a variable (this works fine in SQL Server):
select
@count = count(D.ColumnX),
@totchrg = sum(R.ColumnY),
@totamt = sum(DerivedTable.ColumnA),
@totamt1 = sum(RO.ColumnZ)
from Table1 D, Table2 R, Table3 RO,
(select isnull(sum(Column1),0) ColumnA,ColumnKey1 ,ColumnKey2
from Table4
group by ColumnKey1 ,ColumnKey2) DerivedTable
where D.ColumnKey1 = R.ColumnKey1 and
D.ColumnKey2 = R.ColumnKey2 and
D.ColumnKey1 = RO.ColumnKey1 and
D.ColumnKey2 = RO.ColumnKey2 and
D.ColumnKey1 = DerivedTable.ColumnKey1 and
D.ColumnKey2 = DerivedTable.ColumnKey2
Is there any quick fix for this?
Main Topics
Browse All Topics





by: simongvPosted on 2005-12-12 at 13:09:07ID: 15469584
It may depend on the version of Sybase but unless you have a very old version then it should work. The OUTER is part of the SQL standard (unless I'm mistaken) so should work without any issues. The obvious thing to do would be to try it and see to make sure it works on your version.
The *= format is an older format which is more Sybase specific (though I'm sure SQL server used to use it as they came from the same system). It tends to be used by most Sybase coders still as it's quicker to write than the standard join syntax but for your purposes you'll be better using the outer terminology even if *= does work on both systems.
Sybase definitely didn't support derived tables until recently but I think it was added in a very recent version. I haven't used it, but I think I've seen someone mention it in answer to a question. Hopefully someone can provide more info. If you have a version older than Sybase 12 then no, I'm sure it won't and I don't know if any pre 12.5 (or even later such as 12.5.3) will.