Viewing 15 posts - 16 through 30 (of 57 total)
No, I've answered two questions since then, I deleted it. I do think I looked through the correct numbers being there, and thus pursued the wrong solution, after reading...
January 6, 2014 at 9:31 pm
SELECT CreditCardID,
right('00000000000' + cast (CreditCardID as varchar(10)), 10)
AS ProductionIDColumn
FROM Sales.CreditCard
I just grabbed a random AdventureWorks table to use.
I cast the number to a string, add 10 zeros to the...
January 6, 2014 at 9:28 pm
The example is obviously broken. I wonder what the use of inserting a CDATA section in to XML, in SQL is, any how ?
January 6, 2014 at 9:22 pm
Damn - you're right. I did that, without the row number, and didn't think the right values came out, that's why I started looking at group by.
To the OP...
January 6, 2014 at 9:18 pm
True - the real question is, does his calculated column come from a single row, or is it an aggregate ? I couldn't find any combination that gave the values...
January 6, 2014 at 9:11 pm
Great. If I'm not, you need to explain where you want those numbers to come from, what they are calculating, and we can try again 🙂
January 6, 2014 at 9:07 pm
select employee_id,date_joined ,max(date_) as maxDate, sum(ROUND((sal+due_amount),2))
from employee
group by employee_id, date_joined
I cannot work out where 8.6 and 4.64 are supposed to come from. If I knew that, I would know...
January 6, 2014 at 8:58 pm
There is much wrong here, starting with the idea of having one proc do three things based on a 'magic number'. I suggest breaking this in to three procs,...
January 6, 2014 at 8:36 pm
When you want to merge different counts, create them in CTEs and them join them together:
DECLARE @date datetime = '10/21/2013'
;WITH opened
AS(
SELECT [group], count(1) as [count] FROM #TempTable WHERE createDate...
January 6, 2014 at 8:05 pm
*grin* Ed did not want to ignite debate, but it was inevitable. I agree with Scott, creating a third column of meaningless data makes no sense, if a natural,...
January 6, 2014 at 7:49 pm
I repeat. The first issue is not how complex this query will be to deal with how broken your table design is. Your first issue is, defining business...
January 5, 2014 at 10:11 pm
"Please help me to generate a Select query which can determine all Daily Schedules for current Day which might fall in any of Schedule Type and Due_Day."
"Schedule_Type can be Weekly,...
January 5, 2014 at 9:57 pm
To start, here's SQL to create this data:
CREATE TABLE file_list
(
file_ID int identity,
file_status varchar(10),
customer_name varchar(50),
Direction varchar(3),
First_Directory varchar(100),
Original_filename varchar(150)
)
INSERT...
January 5, 2014 at 9:22 pm
That last response is *insane*. The OP said they have no idea how to write SQL. The size of their database, is irrelevant.
January 5, 2014 at 9:05 pm
Viewing 15 posts - 16 through 30 (of 57 total)