Viewing 15 posts - 1,711 through 1,725 (of 3,482 total)
I guess I should see if I can find some more books... a few more and I'm gonna have to buy a new book case, or just dump some ......
November 8, 2016 at 7:51 pm
Thanks, Alan... is there a book on T-SQL that discusses using Temp tables etc vs TVFs etc? and CROSS/OUTER APPLY too? (although I like SQLKiwi's explanation of the topic)...
November 8, 2016 at 4:11 pm
Thanks for answering... I was wondering especially about when to use Temp tables etc when writing queries. Most of the stuff I read doesn't cover really complex querying, which...
November 8, 2016 at 2:58 pm
Does this work? Where's your data for 25?
SELECT CID
,SUM(Worked) AS Hrs_Worked
,SUM(Sick) AS Hrs_Sick
FROM (
SELECT CID
, Hrs
--, Hr_type
, CASE WHEN Hr_Type IN ('Full', 'Part', 'Contract') THEN Hrs ELSE 0 END...
November 7, 2016 at 4:37 pm
This is a bogus question.
There are times when you need table-valued functions, and even cursors, which a lot of developers strongly dislike. Sometimes, using a cursor is the best...
November 7, 2016 at 11:59 am
You need OR, not AND.
select * from #employee
where FirstNm = 'John'
OR FirstNm = 'Linda'
November 6, 2016 at 7:00 pm
What would you return if the value were NULL? Kind of depends on what you're trying to do. NULL is no the same as zero. NULL means "unknown".
If you're...
November 5, 2016 at 2:36 pm
This worked...
USE Tempdb;
GO
DROP TABLE #tempTable;
GO
CREATE TABLE #tempTable(
col1 varchar(5),
col2 varchar(5),
col3 varchar(5)
);
GO
INSERT INTO #tempTable VALUES ('aa', '100', 'vv'),
('200', 'bb', 'dd'),
('dd', 'nn', '300');
SELECT COALESCE(TRY_CONVERT(INT,col1),TRY_CONVERT(INT,col2),TRY_CONVERT(INT,col3)) AS Result
FROM #tempTable;
If the TRY_CONVERT...
November 5, 2016 at 1:53 pm
We don't do your homework... that's your job. the way to test your design is to add a few records to your table and test... did you do that...
November 4, 2016 at 8:48 pm
"However I do not know how to create multiple groupings based on different parts of the same sql server 2012 column containing different literals."
Normalization is a beautiful thing. And...
November 2, 2016 at 2:08 pm
"However I do not know how to create multiple groupings based on different parts of the same sql server 2012 column containing different literals."
Normalization is a beautiful thing. And...
November 2, 2016 at 2:06 pm
why not just put each letter in its own rectangle? (and all 3 inside another rectangle). Then you can control the page breaks yourself
November 2, 2016 at 9:11 am
Where to start...
you need to get the age of each sale (or whatever it is) in days, so you can put them into [1-30], [31-60], [61-90] days old bins...
I'm calculating...
October 31, 2016 at 10:14 pm
Welcome to SSC,
Since you're new here, the first thing you should learn about is how to ask a good question. Jeff Moden wrote a terrific article on it, which...
October 31, 2016 at 5:49 pm
You should definitely read the article Jeff suggested. It's the only reason I'm thinking I shouldn't post this yet. It's just one of those "Ask a better question to get...
October 29, 2016 at 6:05 pm
Viewing 15 posts - 1,711 through 1,725 (of 3,482 total)