Viewing 15 posts - 1,981 through 1,995 (of 3,543 total)
1.
SELECT s2.[name]
FROM [sales] s
INNER JOIN [sales] s2 ON s2.city = s.city AND s2.[name] <> s.[name]
WHERE s.[name] = 'jones'
GROUP BY s2.[name]
HAVING COUNT(*) = (SELECT COUNT(*) FROM...
February 24, 2006 at 7:31 am
Check the Language setting for the logins on both servers as this will affect the ways dates are converted unless explicitly specified using SET DATEFORMAT as mkeast stated.
February 23, 2006 at 7:06 am
or
SELECT STUFF(CONVERT(varchar,GETDATE(),110),3,3,'')
February 22, 2006 at 7:07 am
If the table has a unique key then
SELECT (SELECT COUNT(*) FROM b WHERE b. <= a.), a.
FROM a
but check the performance though
February 22, 2006 at 7:02 am
If you want the result in varchar then
CAST((@col_yr_no*10000)+(@col_mm_no*100)+1 as varchar)
February 10, 2006 at 7:10 am
Yes could be two interpretations
Based on your interpretation
SELECT TOP 3 g.[ID],g.Title,g.Popularity
FROM Games g
WHERE NOT EXISTS(SELECT * FROM Games g2
INNER...
February 2, 2006 at 3:21 am
CREATE TABLE #temp (ID2 int IDENTITY(1,1),[ID] int,Title varchar(30),Popularity int,Related int)
INSERT INTO #temp ([ID],Title,Popularity,Related)
SELECT g.ID,g.Title,g.Popularity,MAX(ISNULL(SIGN(r.rID),0))
FROM Games g
LEFT OUTER JOIN Related r ON r.ID=g.ID
GROUP BY g.ID,g.Title,g.Popularity
ORDER...
February 1, 2006 at 7:27 am
The error is telling you that the value of ptrval is null and is caused by either
The table is empty
Or the row in the table has null in the column...
January 26, 2006 at 7:17 am
![]() | I do think this is the first time I've seen an inner, left and cross join all in... |
January 26, 2006 at 2:09 am
![]() | But what does that SUM SIGN ISNULL do? |
Because the query uses LEFT OUTER JOIN for @ObPrefs, if...
January 25, 2006 at 10:00 am
Create and use a wanted table e.g.
DECLARE @Wanted TABLE(PrefName VARCHAR(10))
INSERT INTO @Wanted VALUES ('nodogs')
INSERT INTO @Wanted VALUES ('waterside')
SELECT o.obId, o.obName
FROM @Obs o
CROSS JOIN @Wanted w...
January 25, 2006 at 7:09 am
The ESCAPE cannot be within the string passed to LIKE it must be outside e.g.
set @str = '%^[7 Diamonds !!! !^]%'
where extbName like @str Escape '^'
January 24, 2006 at 7:45 am
Using a temp table, not sure if results are right
CREATE TABLE #temp (period int, rfreq int, pfreq int, startdate datetime PRIMARY KEY CLUSTERED...
January 24, 2006 at 7:31 am
Depends if the table has indexes
If not then either will use a Table Scan
If the column is indexed SUBSTRING will use Index Scan and LIKE will use Index Seek
If the...
January 24, 2006 at 6:02 am
Viewing 15 posts - 1,981 through 1,995 (of 3,543 total)