Viewing 15 posts - 1,426 through 1,440 (of 1,489 total)
I am not sure what you are trying to do, but a brief look suggests that you may be able to get away with a select along the lines of:
SELECT...
October 5, 2006 at 8:24 am
FYI, the second version should be faster as it scans YourTable once instead of five times.
October 5, 2006 at 6:57 am
If possible, normalize the table.
If you have to live with it, something LIKE this should work.
SELECT D.u_id, D.job_id, D.Hours
FROM (
SELECT u_id, job_id, m_hours as Hours, 1 as HourOrder FROM YourTable
UNION...
October 5, 2006 at 3:25 am
An obvious typo on my part which is now corrected:
SELECT B.BookID AS Publication
,B.Title
,B.ISBN
,B.YearOfPublication
,P.PublisherName
,B.PlaceOfPublication
,B.Verified
,B.BookType
,P1.Surname + ' ' + P1.Initials
+ ISNULL(', ' + P2.Surname + ' ' + P2.Initials, '')
+...
October 3, 2006 at 8:59 am
Assuming:
1. A book has at least one author
2. dbo.BookAuthor.[Sequence] goes from 1 for first author to 3 for third author
Try something like:
SELECT B.BookID AS Publication
,B.Title
,B.ISBN
,B.YearOfPublication
,P.PublisherName
,B.PlaceOfPublication
,B.Verified
,B.BookType
,P1.Surname + ' ' + P1.Initials
+...
October 2, 2006 at 5:59 am
It could be a data type precedence problem.
eg If jrlid is a char it will automatically to promoted to a varchar and any indexes on jrlid will not be used....
September 21, 2006 at 11:03 am
Looking this up on th web the following function may be more accurate over short distances (read the contents of the link):
CREATE FUNCTION dbo.GreatCircleDistance2
(
@Latitude1 float = NULL,
@Longitude1 float = NULL,
@Latitude2...
September 21, 2006 at 10:41 am
Just managed to have a quick look at this.
The problem seems to be in the function where rounding can cause the cosine to be greater than 1 when the co-ordinates...
September 21, 2006 at 9:29 am
Not sure about the insert but could try creating the temp table with default db collation.
create table #temp
(
TreeID int not null
,Dist float not null
,AddressLine1 varchar(50) collate database_default not null
)
I do...
September 21, 2006 at 7:54 am
This looks like geocodes although float would be a better data type.
With geocodes Pythagoras’ therom does not work very well away from the equator. (It fails completely at the poles!)
Spherical...
September 21, 2006 at 6:30 am
It could be any number of issues.
It may be a data type issue.
ie If AttributeID and/or DateID are not INTs (ie they could be tinyints or smallints) then they
will automatically...
September 8, 2006 at 6:54 am
You will have to provide more information.
Your query will not run as Col1 is ambiguous.
Why do you left join when the join to #temp will take out any nulls in...
September 8, 2006 at 5:41 am
You probably have a null in either LastName or Firstname. ( null + 'Anything' = null)
There is no need for a function as something like the following should work:
SELECT LastName
,FirstName
,CASE WHEN...
September 8, 2006 at 4:03 am
There is no need for an outer join here:
SELECT T.*
FROM dbo.Ticket T
JOIN dbo.Audit A ON T.ticket_id = A.ticket_id
JOIN ( SELECT A1.ticket_id, MAX(A1.last_updated_date) AS last_updated_date
FROM dbo.Audit A1
GROUP BY A1.ticket_id) D
-- filter audit...
September 7, 2006 at 11:16 am
>> I want to ask what type of sp can be used
You do not allow your users delete access to the table and force them to use a...
September 3, 2006 at 10:33 am
Viewing 15 posts - 1,426 through 1,440 (of 1,489 total)