I have two columns like that: ihour (type=HH:mm:ss) 06:40:41 its (type=timestamp) 2020-12-10 00:00:00.000000 I want to add ihour to the its column and have a single column showing me date and time. How can I do this in Vertica? If you know how to do it in another db’s, I would be happy because at least I could learn the
Running count SQL server
Can someone please help me in counting the rows in SQL Server Expected result Answer Try this:
How can I return multiple rows in AsyncPG?
Let’s say I have a table with the following format: favoritefood favoritedrink pizza water ice cream orange juice pizza milk How would I return both rows with pizza as the favorite food with Python? I have fetchrow implemented for other functions, but it only works for one row, of course. Ideally, they would be sorted into dictionaries (ex: {favoritefood: pizza,
SSIS – Inserting records only if they don’t already exist based on matching at least 1 of multiple columns
I have an SSIS package that is supposed to insert data from a flat-file into a database table. For the sake of this example, let’s say I am wanting to insert User records. The data records come from …
Dynamic SQL mistakenly looks for table variable
my code accepts table name parameters and my dynamic code is supposed to query a table. I consistently get the error: @sourcetbl variable must be declared. After a lot of troubleshooting, I realized …
Can you combine case and top statements to label which values are in the top few (Microsoft SQL)
I have a list of fees to summarise, where each fee is used repeatedly over time. My project is to sum the value of each fee over a year, and to label which of these are in the top 80 by value, and …
group by category to show difference by month in SQL
I have a view that brings the total number of members in each class for each month however I want to show the growth by subtracting the total_count of the previous month with the current month in a separate column. For example, I would like to view the data as mentioned in the attached image. Here on that table, you
How do I get two different counts from a table in select query
I am trying to have my select query pull the count of items that exist in both tables in one column, and the count of the items that only exist in one table. These two queries give me the data I need, but would like it come from one query. Thanks in advance. Desired Result: Answer You can combine a
Oracle XMLTYPE extract root prolog value
I have sample Query with XML like below: Output: I am trying to fetch the values below within the query or a new query: Is there any way to do that? Any help / direction appreciated. Answer You just have to complete your first XMLTABLE query (h) in this way:
Pivoting rows to columns with custom column names in SQL Server
I’m having some difficulty with pivoting rows into columns as I also want to name the columns. Here is my current code, modified: And my current output: Just for the sake of shortness, I replaced the actual Message with longmessage1 above. My desired output: The maximum amount of greetings is six, and if a Message doesn’t have six, I’m fine