devxlogo

Tip Bank

Sorting “Codes” within a Column

Question: I have a table that consists of numbers stored as characters.How can I sort them in numerical order? I can’t convert thisfield to numeric because some content is alpha

CHECK Constraint To Avoid Overlapping Data

Question: [Joe Celko’s Reservations Puzzle]Since I spend a lot of time this column talking about problems with the order of execution of SQL statements, it is only fair that I

Finding the Greatest Lower Bound

Question: [Joe Celko’s Sales Gaps Puzzle]Given a table “sales” and a column “saledate” and “customer,” is there a way to get the average number of days between sales dates for

Indexes in SQL

Question: Is it possible to set indexes between tables in SQL expression? Answer: You can establish indexes on SQL tables, but SQL indexes do not create an implied relationship between

Wildcard Searches in SQL

Question: Are wildcards allowed when trying to matchthe contents of a textfield as in the following example? SELECT * FROM Database WHERE textfield = ‘B*’ Answer: Yes, but you’ll need

Calculating Running Totals

Question: [Joe Celko’s Quantity on Hand Puzzle]You are now the guy in charge of the company inventory. You get requisitions that tell how many widgets people are putting into a

What is Microsoft’s Active VRML proposal about?

Question: What are the key features of Active VRML? Answer: Microsoft’s Active VRML, is a proposal built on top Microsoft’s Direct X suite of graphics/multimedia APIs, and also incorporates Microsoft’s