Viewing 15 posts - 2,026 through 2,040 (of 4,087 total)
I've looked at this, and I have lots of questions. Specifically, it looks like a_site_id should be part of the primary key, but it is not used in any...
January 5, 2017 at 3:02 pm
Both of these tables contain a foreign key to a table that you did not provide a definition for, so they will not run as written. You really need...
January 5, 2017 at 9:58 am
bzoom100 (1/5/2017)
I've been copying the code as created by SQL Report Builder. Thank you for the advice on formatting. I'm learning. 🙂
Part of the problem was that you didn't use...
January 5, 2017 at 9:46 am
mcfarlandparkway (1/4/2017)
selecting rec from...
January 5, 2017 at 9:41 am
Lynn Pettis (1/5/2017)
adonetok (1/5/2017)
There are memberid and membername in one table member.One memberid shoud match only one membername.
How to code to find out different names with the same memberid?
select memberid,...
January 5, 2017 at 8:50 am
Luis Cazares (1/5/2017)
Rasmus Remmer Bielidt (1/5/2017)
I didn't see anybody making this point, but COALESCE() absolutely needs a non-null argument or it will throw an...
January 5, 2017 at 8:38 am
Another option is to use the OFFSET function that introduced in SQL 2012 and was specifically designed for paging.
DECLARE @page_size INT = 500, @page_num INT = 1
WHILE @page_num > 0
BEGIN
SELECT...
January 4, 2017 at 2:45 pm
Luis Cazares (1/4/2017)
drew.allen (1/4/2017)
Brandie Tarvin (1/4/2017)
I like CASE personally because it allows me to alter values being returned (or add new information) where as COALESCE just returns the original value.
But...
January 4, 2017 at 2:33 pm
SQL Server is a database tool, not a reporting tool.
SSIS is an ETL tool, not a reporting tool.
SSRS is a reporting tool. Use the correct tool for the job.
Drew
January 4, 2017 at 2:10 pm
Your expected results don't match your sample data. Specifically, 08400124 and 15512890 should be included and there is no record with 15507086, so that cannot appear in the results.
Here...
January 4, 2017 at 2:02 pm
I treated this as a variation on the gaps and islands problem. This following works for your (extremely small) sample data.
;
WITH usernames AS (
SELECT *, ROW_NUMBER() OVER(PARTITION BY un.username...
January 4, 2017 at 1:47 pm
dndaughtery (1/4/2017)
January 4, 2017 at 12:28 pm
This can be accomplished with a ROW_NUMBER().
DECLARE @cities TABLE (
city VARCHAR(25),
stCHAR(2)
)
INSERT @cities(city, st)
VALUES
('Danville', 'KY')
,('Danville', 'FL')
,('Danville', 'TN')
,('Marthasville', 'KY')
,('Marthasville', 'FL')
;
WITH cities AS (
SELECT c.city, c.st, ROW_NUMBER() OVER(PARTITION BY c.city ORDER BY s.state_priority)...
January 4, 2017 at 12:24 pm
Brandie Tarvin (1/4/2017)
drew.allen (1/4/2017)
Brandie Tarvin (1/4/2017)
I like CASE personally because it allows me to alter values being returned (or add new information) where as COALESCE just returns the original value.
But...
January 4, 2017 at 11:28 am
Thom A (1/4/2017)
Brandie Tarvin (1/4/2017)
Thom A (1/4/2017)
January 4, 2017 at 11:02 am
Viewing 15 posts - 2,026 through 2,040 (of 4,087 total)