Join operators  Joins and text and image columns

Chapter 4: Joins: Retrieving Data from Several Tables

Datatypes in join columns

The columns being joined must have the same or compatible datatypes. Use the convert function when comparing columns whose datatypes cannot be implicitly converted. Columns being joined need not have the same name, although they often do.

If the datatypes used in the join are compatible, Adaptive Server automatically converts them. For example, Adaptive Server converts among any of the numeric type columns—bigint, int, smallint, tinyint, unsigned bigint, unsigned int, unsigned smallint, decimal, or float, and among any of the character type and date columns—char, varchar, unichar, univarchar, nchar, nvarchar, datetime, date, and time. For details on datatype conversion, see Chapter 15, “Using the Built-In Functions in Queries,” and the “Datatype Conversion Functions” section of the Reference Manual.





Copyright © 2005. Sybase Inc. All rights reserved. Joins and text and image columns

View this book as PDF