Viewing 15 posts - 16 through 30 (of 911 total)
For over 30 years, the convention on SQL forums has been to post DDL (so we know what the keys are the datatypes of columns, any important constraints, etc.) and...
October 13, 2023 at 9:08 pm
Please do a little research. There is an ISO 8601 standard for week numbers within a year. It's very popular in Scandinavian countries, and you can find lots of calendars...
October 9, 2023 at 8:23 pm
Everything you posted is horrible and needs to be redone. IDENTITY is a table property and cannot be used as a key. You have more NULLs in this one table...
October 2, 2023 at 9:37 pm
Let us try to clean up your code and help you build good habits since you are new to this. First of all, a table must have a key and...
September 25, 2023 at 11:33 pm
The first thing we need to do is get some valid DDL. Your singular table name indicate you have only one Rate. I’m pretty sure that’s not true. The vehicle...
September 18, 2023 at 7:02 pm
Your approach to SQL is wrong. This is a declarative language but you are writing code as if you were still doing Fortran with file systems. Instead of scratch tapes,...
September 1, 2023 at 6:38 pm
I think I'll go to the other extreme. I am waiting for eye surgery right now, so there will be a little delay, but I will develop an article for...
August 26, 2023 at 5:13 pm
You've made the usual beginner's mistake of confusing a table with a 1950s file system. We have had the daytime2(n) datatype for several years now, so there's no need to...
August 22, 2023 at 4:34 am
>> I am trying to add week number by month so Feb would have weeks 1 -4, March 1-5 etc. <
Build a calendar table.
First, look up the ISO 8601 standards...
July 3, 2023 at 2:20 pm
>> I have a select statement below which gives the expected results of duplicate data. <<
I hate to tell you this, but in RDBMS "expected results of duplicate data" is...
July 1, 2023 at 5:14 am
CREATE TABLE Timesheet
(user_id..,
etc, UNIQUE (user_ifd,login_timest),
login_timestamp DATTIME2(7) NOT NULL,
logout_timestamp DATTIME2(7),
CHECK(login_timestamp <=logout_timestamp),
);
The unit of work is a period of time which you are logged in. The duration is defined by a starting...
June 12, 2023 at 8:02 pm
This old article might be useful to you:
March 14, 2023 at 8:43 pm
And this is why we want posters to always put the DDL for their tables where we can see them. After 30+ years of doing SQL and RDBMS, I would...
March 13, 2023 at 10:56 pm
I am assuming that the foobars have a key made of the foo_description in the foo_id.
SELECT foobar_id
FROM Foobars
WHERE foobar_description IN ( 'Apex', 'Bill', 'Sierra' )
GROUP BY foobar_id
HAVING COUNT (*) =...
March 13, 2023 at 5:34 pm
Please quit being rude to people that are trying to help you. Where is the DDL? If you remember the first week of any class or chapter of any book...
March 13, 2023 at 3:23 pm
Viewing 15 posts - 16 through 30 (of 911 total)