I’m creating an external table using ‘partitioned by’ but I get the following error: ‘Invalid operation: column “#id” duplicated’ I first thought it could have something to do with the character #, …
Tag: sql
PHP copying the result from a SQL Query into a CSV file writes only the last line
I’m trying to take some results from a query that I do to Oracle and paste them on a CSV file, the problem is that, in the foreach loop, the code should writes line by line, but he writes only the …
How to sort by pagerequest with inner join
I have two tables with many to one realtion. I want to sort data in table “user” by column “street” that is in “address” table in ASC or DESC direction defined by request param: localhost:8080/…
Is there a way to search for a matching string with multiple variants in a column?
I have a table that contains the colum “CompanyName”. I want to get all rows that mach with a specific string. +—-+———————-+——————-+———+———+ | Id | CompanyName …
How to retreive one single value in comma separated columns form, from a table in sql server?
I have a column with values like the one below. I need to separate value number 10 from each row in SQL sever (being value 1 the first one in the string, second after the first comma and so on). …
How do I select the max(timestamp) from a relational mysql table fast
We are developing a ticket system and for the dashboard we want to show the tickets with it’s latest status. We have two tables. The first one for the ticket itself and a second table for the …
How to handle aggregate function in Case statements when it involves date columns
I’m calculating invoiceDate vs currentDate then sum Value/Amount column grouping by Customer but its returning “invoiceDate is not contained in either an aggregate function or the GROUP BY clause” …
Regular expression blacklist
Can someone explain to me the meaning of the following query: SELECT message.message FROM message CROSS JOIN Blacklist WHERE(message.message LIKE {fn CONCAT({fn CONCAT(‘%’, Blacklist.Words)}, ‘%…
Convert SQL query to Entity Framework which used AggregateFunctions and Where clause
How can I convert this query to Entity Framework? SQL query: SELECT Fullname, SUM(CoinCount+DiamondCount) AS GeneralPoint FROM Students, Groups WHERE Students.GroupId = Groups.Id AND Groups.Name = ‘…
LIKE in multiple columns
I have columns title, description, keywords and I want to search a text in them. I’m using PostgreSQL. SELECT title FROM products WHERE ANY(ARRAY(title, description, keywords) like ‘%test%’) I’…