Forum Replies Created

Viewing 15 posts - 91 through 105 (of 911 total)

  • Reply To: T-SQL query combine rows into a single column

    >> I'm a newbie to T-SQL. <<

    Please read any book on basic RDBMS. As Dykstra used to say to his students, "you're doing everything completely wrong."

    CREATE TABLE Tests

    (person_id INTEGER NOT...

    Please post DDL and follow ANSI/ISO standards when asking for help. 

  • Reply To: SQL Query Help on Time based query

    >>

    I have a following table ..<<

    No this is not a table at all. By definition, a table must have a key, yet all your columns can be NOT NULL, so...

    Please post DDL and follow ANSI/ISO standards when asking for help. 

  • Reply To: Using GetDate in HAVING clause

    >> I have a table [UPSBatchInvNo] with column [ batch_date] formatted as 112621.<<

    First of all, we prefer that people post DDL and not a narrative. We have no idea what...

    Please post DDL and follow ANSI/ISO standards when asking for help. 

  • Reply To: Update alias or update tablename when from clause is specified

    November 29, 2021 at 3:16 am

    #3957742

    REPLY | REPORT | QUOTE

    I would like to ask your opinions and recommendations on how to properly write an update with a from clause. I'm putting this in the...

    Please post DDL and follow ANSI/ISO standards when asking for help. 

  • Reply To: sql query help

    >>I have a table with the below data. <<

    Where is the DDL? For over 30 years. Standard netiquette on SQL forums has been to post DDL when you want help....

    Please post DDL and follow ANSI/ISO standards when asking for help. 

  • Reply To: Query help

    Please read any book on basic data modeling or SQL. By definition, a table must have a key. A key is a particular subset of attributes in that table that...

    Please post DDL and follow ANSI/ISO standards when asking for help. 

  • Reply To: Splitting one wide column into serveral different ones

    I'll go one step further. This is not a problem for SQL and we never intended the language to be use this way. Can you preprocess your raw data? You...

    Please post DDL and follow ANSI/ISO standards when asking for help. 

  • Reply To: Using an OR in a CASE statement

    30 years ago, when I was on the ANSI X3 H2 SQL standards committee, I used to go out of my way not to offend snowflakes. The result was they...

    Please post DDL and follow ANSI/ISO standards when asking for help. 

  • Reply To: SQL query help

    >> I have a table structure such that each record [sic: row are not records] has a lookback to a previous record [sic]. <<

    Since the table is an unordered set,...

    Please post DDL and follow ANSI/ISO standards when asking for help. 

  • Reply To: replace chain of function calls with better code

    The horrible truth is that our calendar system is very irregular in our definition of the business day is even worse. Trying to do some temporal calculations like this with...

    Please post DDL and follow ANSI/ISO standards when asking for help. 

  • Reply To: How to return a range value based on the first day of year and the value of row

    >> I have a table called Events, the value of that table like as bellow :<<

    Actually you don't have a table in your posting. By definition, a table must have...

    Please post DDL and follow ANSI/ISO standards when asking for help. 

  • Reply To: how to get quantity from yesterday 6pm till today 6pm

    >> I am looking to create a CASE statement NOT NULLsic .. <<

    There is no CASE statement in SQL; it is an expression

    >> that gets different quantities. For example, I...

    Please post DDL and follow ANSI/ISO standards when asking for help. 

  • Reply To: Datediff (exclude holidays - no function)

    The Julian or ordinal business day is a good trick. Number the days from whenever your calendar starts and repeat a number for a weekend or company holiday.

    CREATE TABLE Calendar

    (cal_date...

    Please post DDL and follow ANSI/ISO standards when asking for help. 

  • Reply To: grouping rows into sets

    >> wish to group rows into "sets" based on t_id and t_type. <<

    This makes little sense to me. You already have your sets defined by the t_id, So there’s no...

    Please post DDL and follow ANSI/ISO standards when asking for help. 

  • Reply To: Update table from other tables

    >> Basically I have 2 tables check-in and check-out where users check-in and check-out using an RFID card. I am wanting to display who's in the building or has been...

    Please post DDL and follow ANSI/ISO standards when asking for help. 

Viewing 15 posts - 91 through 105 (of 911 total)