I am not good with SQL at all, barely have an idea on how to do basic scripts suck as delete, drop, add. I have this data with about 12 columns, I want to add a calculated column which will change depending if a special character shows up in another column. lets say that is the idea, I want to
Tag: sql
tricky SQL with substrings
I have a table (postgres) with a varchar field that has content structured like: The uuid can occur in more than one record. But it must not occur for more than one combination of [givenname];[surname], according to a business rule. That is, if the John Smith example above is present in the table, then if uui…
MySQL query delivers wrong result when using (not equal) in WHERE clause
I came accross a strange problem with a MySQL Query The problem is, that the last query (Members with lastname != ‘Smith’) returns 0. If there are 100 members in total and 20 members named ‘Smith’, the number of member with other last names should be 80, shouldn’t it? I tried dif…
sql server – How can I put the values in a result side by side
How can I put the values(RESULT) in a result side by side How can I do it? –> Set @DomainName = ‘marka.com’ @DomainName = ‘marka.com’ –How do I add Answer
Is there any better way to avoid data skew by join in Redshift?
The query SQL as below cause one node of Redshift cluster disk full And query plan is From the above image we know node-39 hold more data than other nodes. Because data is skewed by join. To solve this issue, we try to use update instead of join Query plan The data is distributed evenly on all nodes according…
Cannot execute SQL query
I have the following code to execute a SQL query in vb.net : opdragaliaens.CommandText = “UPDATE UBH ” & “SET ton = wh.total_net ” & …
Captalizing Each Word of an existing table
I have a table called ‘Artists’. There is a column called Artist in ‘Artists’. Artist firstname lastname Firstname lastname Firstname Lastname firstname I tried the query on this Post I want to …
how can i fetch the name from id by using this query?
there are 2 table tbl_hk and tbl_hk_work: tbl_hk:hk_id(pk), hk_name tbl_hk_work:hk_work_id, hk_id(fk), hk_work_date, hk_work_1bed, hk_work_2bed, hk_work_time and I have written a query to fetch sum …
Find users with most number of common pages they liked
I am trying to find pairs of users who liked the same pages and list the ones who have the most common page likes at the top. For simplicity I am considering the following table schema Likes (…
Grouping By Date When Used In Case
I’ve got a working query where I can export to Excel and pivot myself to not be grouped by the fldTrancationDateTime column and that is working fine as a short term solution. Is the only option here to use SQL pivot so I can only group by the Product and have each date range populated? Instead of one ro…