I have the following query that returns duplicates that i am running on sql server. So I need to write a query that will update second instance of the email address based on the select query that retrieves dulicates to for example imports@rohnis.com to imports@rohnis.com.duplicate. If it is info@eps.ws then i…
Should i convert a file to Base64 before or after sending it to the backend?
First of all, i am aware that saving a Base64 string in the database is not the most efficient way to save images, but i do not have a lot of them and load them rarely, so that should not be a problem….
error when I try to activate my code navicat 12
I have an error when I try to activate my code. and I do not know what’s the solution. This is my error : error navicat I had already followed youtube videos to activate navicat 12 and I managed …
How to make this type of query in Laravel?
This is the sql query but how can I do it in laravel? SELECT id FROM clientes where email is null and phone is null and id in(SELECT DISTINCT(cliente_id) FROM reservas WHERE dia < now()) This is …
How to follow user id to get sum of MySQL column in PHP?
I have a column in a table that I want to follow “user id = 3” to get sum of MySQL column in PHP. but it’s not working. Below is my code: <?php $sql_select_point = 'SELECT SUM(…
Grant connect to all DATABASES
I’ve seen there’s a way to grant select to all tables within a database, however I can’t seem to find a way to grant connect to all databases. I can’t manually do: so on so forth, as I have many databases. Is there an equivalent to something like: GRANT CONNECT ON DATABASE * TO readonl…
Easter / Good Friday for Sowflake Date Dim
Further Evolved : The code below satisfies what was wanted in earlier comments [if you follow history] :), my new question right below is stumping me. Question: I want to have ‘Week_Of_Year’ Adjust …
MySQL – removal of duplicate results in JSON_ARRAYAGG in the presence of GROUP BY
I have query: The result of this query duplicates the same image urls in column urlLinks: How can I leave as a result only unique image urls? GROUP BY cannot be removed from the request!!! Answer JSON_ARRAYAGG() does not support DISTINCT. You can SELECT DISTINCT in a subquery, and then aggregate: Demo on DB F…
Query for getting distinct pairs from a single column with an added constraint
How would I go about getting distinct pairs from a column with a constraint that a pair should not be repeated? So I have a query as such This gets me all possible pairs from that column with a constraint that it cannot pair with it self but this can still happen: (1,2) and (2,1). A pair should never be
How to calculate a group average in SQL?
I have a sql data set which look something like: I would like to be able to select the data in such a way that the query will return: With the average result calculated over the 3 years shown for each person. How could I achieve this in SQL Server? Answer I think you want a window function: