Imagining I have this table, I want to be able to find the brands that exist associated with every id. Note that this is not equivalent to finding if the value exists for every row, since a single id …
Issue with passing column name as a parameter to “PREPARE” in Redshift
I am using REDSHIFT for the below question, Here is problem and I am looking for solution. I have 2 tables, one table contains the column combinations on which the second table should group the …
How to query on multiple attributes in the same json object array?
I have a json array similar to this structure in a column of my database – { “id”: “123abc”, “Y/N”: “Y”, “Color”: “Purple”, “arr”: [ { “time”: 1210.55 “person”: “Sean” “action…
How can I include a “Select All” option in my combo box?
I have a combo box that has the list of my distributors, when I select a distributor in the combo box I have a sub-form that list the transactions of that specific distributor. Now I want to include a “Select All” option in the combo box that will display all the transactions of my distributors. I…
Getting the all rows of with any of the lastest N tags
I need to get the all the records of the N latest Tags, i.e. ordered by timestamp. I’ve managed to construct the following query that retrieves the latest 20 tags. However when I try to join on the …
Oracle/SQL: Regexp Similar to LIKE-% but wildcard mandatory (not optional)
I’m in Oracle 10, and need an equivalent of where col like ‘str%’ but where the %-part is not optional. The result of str is not allowed. Is the following correct? WHERE REGEXP_LIKE (col, ‘^str(*)…
Can I combine both two update queries in MySQL to make it faster?
Right now I’m running both of these queries with PHP: UPDATE members SET balance = balance – $cost WHERE id = ‘$member’”); UPDATE campaigns SET h_hits = h_hits + 1, d_hits = …
Count alpha characters in string field in SQL Server
I am using SQL Server Management Studio v17.9.1. I have column in a database table that contains alphanumeric strings. I need to count the letters in the string and produce a table of the aggregate …
SAP HANA | Get string between two strings
I have below data in my table T – ROW Col1 1 utm_source:|utm_medium:kiosk|device:d|expires:Sun, 02 Jun 2019 13:27:28 GMT|IP:10.YYY.YY.YY| 2 IP:10.XXX….
Select * From Table Where column=data is not working [closed]
I am using SQL Server. The following query is working fine: select * from Users where Users.Id = 1 but when I use select * from Users where Users.Username = “User” this does not work. Error: …