I have a table called ‘config’ and when I query it in following manner: SELECT value FROM config WHERE property = ‘SPECIAL_STORE_ID’ its response will be: 59216;131205;76707;167206 //… (1) I want to tokenize the above values using semicolon as the delimiter and then use them in a…
query to insert records to another table by calculating the percentage on a column
I have 2 Postgres tables with the following structure: Lets say I have data in the tmp table as below: I have a script below that inserts the data from public.tmp to public.mo table based on the criteria that if the column STATUS has mix values (COMPLIANT and NC) for a particular HOSTNAME then compliant_statu…
SQL Server select query based on logic
I have the below table : ID Package 1 T 1 E 1 B 1 F 2 E 3 E 3 F 4 F 5 B 5 F I need the below output table : ID Package 1 T 2 E 3 E 4 F 5 B Priority list for the …
Delete row in datagridview and database with C#
I made a database and a program with a datagridview to show the database content. Now I want to make a button to let users delete a row and delete it also in the database. I tried the following …
How can I calculate a percentage from values obtained by 2 different queries in SSMS?
First query: select COUNT(EUpdate) from EmpUpdates where EProj = ‘abc’ and EID = ‘101’; Second query: select COUNT(EProj) from EmpUpdates where EID = ‘101’; percentage = (first query / second …
python list in tuple compare
I have a list and a tuple ( from sqlite query) and what to check if the items in list are not in the db tuple. If not add to newJobs list links = [“example.com”, “mysite.com”] …
SQLite: Order by number of NULL values
In SQLite, is there any way of ordering by the number of NULL values in each row, without having stored this number explicitly in a separate column? Something like SELECT rowid FROM (SELECT rowid, …
After update trigger not updating specific row of data in SQL table
Fairly new to SQL here… I am trying to get an ‘after update’ trigger in SQL Server to update a column (rig_ident) whenever another column (rig_id) is updated. rig_ident is found by searching the …
How to order by with union in SQL to make first select query value first?
In this query: First select query ( SELECT NM, DEP_CD FROM EMP WHERE DEP_CD=’1100′ and (SELECT COUNT(1) FROM BBS_TABLE WHERE UP_DEP_CD = ‘1100’) > 0) always returns 1 result. I want to put this one first in the result values, but there are no regular rules for results so I couldn…
SQL phpmyadmin SELECT and return multiple fields as string concat in a column of parent SELECT
I have 3 tables. users, contents and categories. so a user writes a content and selects a category for that. categories users ————————– ——————–…