Viewing 15 posts - 91 through 105 (of 172 total)
Not sure you are providing all of your business rules, but... here goes
select customer_id
from unusualTable
where (field_number = 1 and field_value = 'BLUE')
OR ( field_number = 3 and field_value=...
July 18, 2007 at 3:52 pm
Suduko solver may be for you!
A SqlServerCentral article a last year was a walk-through for creating a Suduko solver. I was/am a sudoko nut so instead of...
July 13, 2007 at 10:47 am
1 - Condolences for having a 7 piece Primary Key. Shot the key creator, now.
2 - There should be rules in place if you have multiples (max, sum, min,...
July 11, 2007 at 1:40 pm
If the VB program is working correctly why would the program 'run into problems' when you were reading more then one record? This does not sound like a SQL...
July 11, 2007 at 1:31 pm
(DUH) think homer simpson
no need for derived table
SELECT Type_ID
FROM Db1.dbo.TypeTable t1
LEFT JOIN
Db2.dbo.TypeTable) t2
ON t1.field1 = t2.field1 and t1.f2 = t2.f2 and t1.f3 = t2.f3
WHERE t2.field1 is null
July 9, 2007 at 2:39 pm
NOT IN does not allow multiple choices.
The following Join logic MAY get you the logic you want.
SELECT Type_ID
FROM Db1.dbo.TypeTable t1
LEFT JOIN
(SELECT Field1, Field2, Field3
FROM Db2.dbo.TypeTable) t2
ON t1.field1...
July 9, 2007 at 2:38 pm
This may or may not be relevant. But...
Glancing through the error message it appears your are attempting to link to server "(null)", this is in the error message twice.
Are...
June 21, 2007 at 2:44 pm
Step one - refacture names (doc_number =order_no??)
Step two - make the first temp table a derived table
Select Case When Right(doc_number,2) '00' Then 'Nope'
Else doc_number End As order_no
Into...
June 13, 2007 at 2:25 pm
I just love row_number() so i will go on... (and on...)
Example of Row_number()
To find the average value of the last three listings/offers by house/listingid
declare @HouseList table(id INT IDENTITY, listingID INT,...
June 12, 2007 at 4:33 pm
row_number is designed to insert a column that is an integer (pseudo identity) that you can use to get only the latest, last 3, last 10...
I use it myself for...
June 12, 2007 at 4:07 pm
Row_number is populating column rowNum.
In your where statement add [Where rowNum = 1]. This if designed correctly will limit you result set to only the data you want.
Once you...
June 12, 2007 at 3:23 pm
The order by in the Row_number() is for assigning values for the RowNum column.
You now have a table an additional column rowNum assigned a value by the order by. ...
June 12, 2007 at 2:39 pm
Your when statement is only a string
when 'string here'
It appears you are trying to
when exists(select yada from yadatable where yada1 = yada2)
then 'y' else 'n' end
The ticks are turning...
June 12, 2007 at 1:15 pm
It sounds like you are looking for a Pivot Table solution. Perform a search on pivot tables in the TSQL (2k & 2k5) areas. You should find LOTS...
June 12, 2007 at 1:11 pm
Viewing 15 posts - 91 through 105 (of 172 total)