Reputation
2,534
Top tag
Next privilege 3,000 Rep.
Cast close & reopen votes
Badges
9 28
Newest
 Enlightened
Impact
~107k people reached

Jul
21
reviewed Reviewed bring the output into single column from a table as vertical order
Jul
21
revised bring the output into single column from a table as vertical order
improved formatting, removed an apparently duplicate data sample
Jul
21
reviewed Reviewed Create a T-sql script JOB SQL-2012 and scheduled
Jul
21
comment Create a T-sql script JOB SQL-2012 and scheduled
It is still unclear why you need to schedule this. Is this something that is going to be executed at well defined time intervals? If so, how often exactly? It may not matter for the solution, but I'm trying to understand what you are trying to accomplish, in case maybe you don't really need any scheduling for this, just a script that would be run on demand perhaps.
Jul
20
comment COUNT number of column values with INNER JOIN
What version of PostgreSQL are you using?
Jul
20
revised COUNT number of column values with INNER JOIN
formatting, punctuation, typos
Jul
20
comment LEFT JOIN DEFAULT NULL VALUE
@ypercube: Ah yes, there is mentioning of isnull in this answer as well, I didn't notice that at first. (So I only suspected that Chris meant SQL Server, but now I have no doubts that he did.)
Jul
20
comment LEFT JOIN DEFAULT NULL VALUE
Is there a sys.columns in MySQL, though?
Jul
19
comment DECODE or CASE STATEMENT for PARAMETER in WHERE CLAUSE
What is wrong with the SPC.CHARACTERISTIC_CODE like '&Industry' in your posted query? It would seem to work the way you have described, unless SPC.CHARACTERISTIC_CODE can have more values than just ARLFT and MINE and you want to limit the % to just those two.
Jul
19
comment DECODE or CASE STATEMENT for PARAMETER in WHERE CLAUSE
If &industry evaluates to %, SPC.CHARACTERISTIC in () and SPC.CHARACTERISTIC in ('&industry') cannot possibly be true. (You would essentially want a column value to be one of 'ARLFT','MINE' and to be a '%' at the same time, which is impossible.)
Jul
19
comment Database compatibility level
This is well documented in the manual. IMHO you should start from there and ask specific questions when something is unclear.
Jul
16
answered Select Multiple Values from Same Column; one sql statment and split into separate columns
Jul
16
comment Select Multiple Values from Same Column; one sql statment and split into separate columns
Thanks, I probably will because I can't find a generic MySQL Pivot question to flag this one as a duplicate. But please consider rolling back your answer to the original revision too.
Jul
16
revised Database MySQL - Transpoing Table from one form to other
improved formatting
Jul
16
revised How can I run a SQL job every 1 second?
improved formatting
Jul
16
comment Select Multiple Values from Same Column; one sql statment and split into separate columns
And, by the way, you don't really need two views for this, because you can do CASE and MAX in one go: max(case when Item_Type = "first_name" then meta_value end) as first_name.
Jul
16
comment Select Multiple Values from Same Column; one sql statment and split into separate columns
It was a disservice on @RickJames's part to talk you out of using MAX(). The fact that you can reference non-GROUP BY columns without aggregation in MySQL doesn't mean you should. MAX() is important in this particular case. Otherwise your second view will always be returning just nulls in all columns (other than user_id) except one or sometimes without an exception.
Jul
16
comment NC Index not being used
@RayofCommand: Not in SQL Server 2012 or lower, it seems.
Jul
15
revised SQL Server transactional replication issue with database
minor clarification
Jul
15
answered Replace Yes with 1 and No with 0