Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

*= in Sybase SQL

I'm maintaining some code that uses a *= operator in a query to a Sybase database and I can't find documentation on it. Does anyone know what *= does? I assume that it is some sort of a join.

select * from a, b where a.id *= b.id

I can't figure out how this is different from:

select * from a, b where a.id = b.id
like image 949
Adam Tegen Avatar asked Sep 02 '08 21:09

Adam Tegen


People also ask

What does *= mean in Sybase?

Sybase supports both Transact-SQL and ANSI outer joins. Transact-SQL outer joins use the *= command to indicate a left outer join and the =* command to indicate a right outer join. Transact-SQL outer joins were created by Sybase as part of the Transact-SQL language.

What does *= mean in SQL?

That is the ANSI SQL 1989 syntax for RIGHT OUTER JOIN, where *= would be the LEFT OUTER JOIN. You should note also that putting the join syntax in the WHERE clause is deprecated in SQL 2008.

What is the join in Sybase?

Use joins in your CCL query to combine multiple datasources into a single query. Streams, windows, or delta streams can participate in a join. However, a delta stream can participate in a join only if it has a KEEP clause.


1 Answers

From http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.dc34982_1500/html/mig_gde/mig_gde160.htm:

Inner and outer tables

The terms outer table and inner table describe the placement of the tables in an outer join:

  • In a left join, the outer table and inner table are the left and right tables respectively. The outer table and inner table are also referred to as the row-preserving and null-supplying tables, respectively.

  • In a right join, the outer table and inner table are the right and left tables respectively.

For example, in the queries below, T1 is the outer table and T2 is the inner table:

  • T1 left join T2
  • T2 right join T1

Or, using Transact-SQL syntax:

  • T1 *= T2
  • T2 =* T1
like image 56
Adam Tegen Avatar answered Oct 03 '22 04:10

Adam Tegen