Viewing 10 posts - 1 through 10 (of 10 total)
In the past I have used this technique to find the "latest" record for each Product:
SELECT a.Product, a.SaleQuantity, a.SalePrice, a.SaleDate, a.SaleComments
FROM dbo.SalesDetail a
WHERE NOT EXISTS (
SELECT 1 FROM dbo.SalesDetail...
March 16, 2010 at 6:38 pm
[font="Courier New"]CREATE PROCEDURE [proc_update_table] @key_value [int], @column_value [varchar](50)
AS
UPDATE table_name
SET column_in_question = @column_value
WHERE ID = @key_value[/font]
job done...
February 25, 2009 at 1:06 pm
Hi Jeff
Your solution using the "Tally" and derived position tables worked beautifully...
I got exactly what I needed.
That was some mighty fine codin' Mr. Moden.
Your assistance is greatly appreciated.
Cheers
Evan
May 2, 2007 at 12:10 am
It's a moot point because the item value without a positional modifier is meaningless.
As a purely academic exercise to answer you question:
SELECT code_list_id FROM code_list
WHERE (code_1 = 'Charlie' )...
May 1, 2007 at 8:55 pm
Kind of....
If "Charlie" is put into Code_2, then that code line is not returned when you search for records with "Charlie" in Code_3. That is a perfectly valid situation.
May 1, 2007 at 4:54 pm
Sergiy
Yes. The black-box machine that spits out the code lists always produces between 2 and 5 items in a code_list_text value. They are always "stuffed left". There are never blank...
May 1, 2007 at 3:56 pm
Hi Jeff
Old habits die hard and the fingers get ahead of the brain. I meant to type "T-SQL" of course...
Thanks
Evan
May 1, 2007 at 2:56 pm
Segiy
You are correct in some ways. However the typical query is more along the lines of :
select the code_list_ids that have 'Bravo' as the second code item and 'Alpha' as...
April 30, 2007 at 11:12 pm
Sergiy
5 Codes to a list is a hard limit imposed in the legacy system. It won't be added to as I don't think anyone knows how any more...
I don't want...
April 30, 2007 at 10:22 pm
Try using single quotes
select column + ' some text ' as result
from MyTab
Is column defined as a char or varchar? If not you may need to convert to a character...
April 30, 2007 at 3:13 pm
Viewing 10 posts - 1 through 10 (of 10 total)