Viewing 15 posts - 241 through 255 (of 1,923 total)
Something like this?
IF OBJECT_ID('TEMPDB..#CONCAT_COLUMN_VALUES') IS NOT NULL
DROP TABLE #CONCAT_COLUMN_VALUES
CREATE TABLE #CONCAT_COLUMN_VALUES
(
GROUP_ID INT,
COL_VAL VARCHAR(5)
)
INSERT INTO #CONCAT_COLUMN_VALUES
SELECT 1, 'A' UNION ALL
SELECT 1, 'B' UNION ALL
SELECT 1, 'C'...
April 11, 2012 at 10:47 am
Man, your select was the most basics of select 😀
select * from students
Anyways, good that you got it working. And i did not ask you to post you entire table...
April 10, 2012 at 6:05 pm
sqlfriends (4/10/2012)
Schoolname, Grade
Pathfinder K
South Shore 2
Whittier K
Lawton 2
Washington 06
Garfield 09
I want to select all the students in each...
April 10, 2012 at 5:51 pm
Somehting like this?
DECLARE @CurrentDate DATETIME = GETDATE()
,@PrevDate DATETIME
;
SELECT @CurrentDate = DATEADD(MM,DATEDIFF(MM,0,@CurrentDate),0)
;
SELECT @PrevDate = DATEADD(MM,-1,@CurrentDate)
;
;WITH WorkDayNumbers (N) AS
(
...
April 10, 2012 at 4:14 pm
March has the following working week days
dATE dAY
----------------------- ------------------------------
2012-03-01 00:00:00.000 Thursday
2012-03-02...
April 10, 2012 at 2:17 pm
I still quite cant get my head wrapped aroound the logic. Can you please elaborate! I understand how u arrived at March's data (date and Weekday) but how did u...
April 10, 2012 at 1:30 pm
Brandie, are there any Dynamic SQL somwhere that may alter that table's proprety? Normally, u cant catch if that table name is updated/used in a dynamic sql! I know that...
April 10, 2012 at 1:01 pm
hbtkp (4/10/2012)
item1 item2 item3
1 pen 34
1 pen...
April 10, 2012 at 12:53 pm
hbtkp (4/10/2012)
hii am using 1 expression in my tsql and getting error like
Arithmetic overflow error converting expression to data type float.
what is the reason,what should i do
Come on bro!...
April 10, 2012 at 12:42 pm
What are you trying to do? You did not give us any insight into what your CAST/CONVERT should do, neither did u say what your query's intentions is. More details...
April 10, 2012 at 12:35 pm
Lynn/Capt.Hector , correct me if i am wrong, we dont need DATEADD+DATEDIFF in the GROUPBY/ORDER BY; just DATEDIFF would do.
Why i say this, SQL needs to just to wrap the...
April 10, 2012 at 12:11 pm
Please read this article first:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
To know how to post your data in readily consumable format! We all are volunteers! We wont have full time to guess, compile and produce...
April 10, 2012 at 12:03 pm
This?
IF OBJECT_ID('TempDB..#Temp') IS NOT NULL
DROP TABLE #Temp;
CREATE TABLE #Temp
(
iD INT IDENTITY(1,1)
,CR_DATE DATETIME
,[COUNT]...
April 10, 2012 at 11:52 am
This?
DECLARE @TableA TABLE
(
RoomID INT,
BedCount INT
)
;
INSERT @TableA( RoomID ,BedCount)
SELECT 101, 5
UNION ALL SELECT 102, 2
UNION ALL SELECT 105, 3
; WITH Tens...
April 10, 2012 at 11:25 am
Or this?
DECLARE @Example
TABLE (
row_id INTEGER IDENTITY PRIMARY KEY,
...
April 10, 2012 at 9:32 am
Viewing 15 posts - 241 through 255 (of 1,923 total)