As you probably know, in Microsoft database parlance the Text, nText and
Image datatypes all hold very large amounts of data. If you've ever tried to add
these types to a Union query in Visual Basic, the query probably generated
errors, claiming that the Text, nText or Image data type can't be selected as
DISTINCT.
When you run a UNION query, the keyword forces the database to eliminate
duplicates from the results--the equivalent of adding the DISTINCT keyword to
the SQL statement. Text, nText and Image fields, by their very blobular nature,
are potentially too large to be compared one by one by the database. As a
result, you can't select unduplicated records when displaying fields of these
data types.
Fortunately, SQL offers a way around this with the UNION ALL clause. This clause
works exactly like the UNION keyword, except that it selects all records,
duplicates or not. The following SQL provides an example:
SELECT id1, memoText
FROM dbo.tblCatalog
UNION ALL
SELECT id3, browseImage
FROM dbo.tblImages
How to include Text, nText and Image datatypes in a Union query
By ElementK Journals, published on 18 Jul 2001
| Filed in
You might also like...
SQL forum discussion
-
PROBLEM
by royal ludhiana (2 replies)
-
Sql Update Trigger
by ElviOliv (2 replies)
-
SQL server
by raf9 (0 replies)
-
lower and upper limit problem
by ansari.wajid (2 replies)
-
Pls help me, thank you!
by joe90 (1 replies)
SQL podcasts
-
webdev radio: SQL Cookbook review, Aardvark, MySQL tuning, CSS question
Published 8 years ago, running time 0h20m
We have the first book giveaway and cover the Aardvark Firefox extension. I also explain some MySQL performance problems I’ve had recently, talk about some MySQL tools which helped me get over those problems, and ask for some help on a CSS layout question. *CSS Creator Layout Generator :: Ge.
SQL jobs
-
Graduate Reports Developer
Jagex in Cambridge, United Kingdom
To £30k (DOE) + Excellent Benefits / Progression -
Data Architect
Integrative Nutrition in New York, United States
Competitive
Comments