Viewing 15 posts - 8,341 through 8,355 (of 10,144 total)
ningaraju.n (12/16/2009)
--I need the names of Candidates who are having skills belonging to one group
Can you explain how Moe is a "winner"?
INSERT INTO #Candidates VALUES ('Moe', 'Perl'); --winner
INSERT INTO #Candidates...
December 16, 2009 at 7:08 am
Nice work.
There are a number of different ways of achieving the same thing with TSQL, even in the version you are using. Here's one of them:
SELECT ...
December 16, 2009 at 5:49 am
Ryan Keast (12/16/2009)
THANK YOU!!!!
I can understand the logic from this now.
Out of intrest at the very end of the SELECT statement you have a ...
December 16, 2009 at 4:30 am
Try this, Ryan:
SELECT *,
[Age Range] = CASE
WHEN [Age] < 18 THEN 'Juvenile'
WHEN [Age] BETWEEN 18 AND 31 THEN '18 TO 31'
WHEN [Age] BETWEEN 32 AND 41 THEN '32 TO 41'
WHEN...
December 16, 2009 at 4:00 am
This should get you started, Dean:
DROP TABLE #MySampleTable
CREATE TABLE #MySampleTable (col1 INT, col2 INT, col3 INT, col4 INT, col5 INT, col6 INT, col7 INT)
INSERT INTO #MySampleTable (col1, col2, col3, col4,...
December 15, 2009 at 9:26 am
Ryan Keast (12/9/2009)
So take it a bit further and say if between age 25 and 48 then "25-48" and add more if I need...
December 15, 2009 at 6:53 am
This expression for returning age range bears little resemblance to TSQL:
(SELECT CASE WHEN (SELECT DATEDIFF(year, PERSON.[D-O-B], GETDATE())
- CASE
WHEN MONTH(GETDATE()) > MONTH(PERSON.[D-O-B]) THEN 0
WHEN MONTH(GETDATE()) = MONTH(PERSON.[D-O-B]) AND...
December 15, 2009 at 2:49 am
Something like this:
WHERE headcount = 'transfercluster'
OR headcount = CASE WHEN @Consolidate <> '(Retail Consolidate)' THEN 'TransferConsolidate' ELSE CAST(NEWID() AS CHAR(36)) END
December 15, 2009 at 2:39 am
You can use CASE in a WHERE clause, but that's not the problem - you are trying to construct a list on-the-fly for the IN operator. The syntax of your...
December 15, 2009 at 2:15 am
There's an alternative syntax which you may find more intuitive:
SELECT IDENTITY(int, 1, 1) AS RowID, ...
INTO #temp
FROM ...
December 14, 2009 at 9:46 am
GSquared (12/14/2009)
CirquedeSQLeil (12/11/2009)
December 14, 2009 at 9:41 am
GSquared (12/14/2009)
That doesn't look like T-SQL. Not sure what it is, but I doubt it's from an MS SQL database.
<<from dual>> Oracle?
December 14, 2009 at 8:32 am
sibir1us (12/10/2009)
December 14, 2009 at 6:59 am
GSquared (12/11/2009)
December 14, 2009 at 2:04 am
CirquedeSQLeil (12/11/2009)
As for the requirements and desired output, Chris was spot on. If this does not do exactly what you envisioned - we need to...
December 11, 2009 at 9:12 am
Viewing 15 posts - 8,341 through 8,355 (of 10,144 total)