How should I delete a row using a java variable in SQL table? I am trying to delete a record from table member (with two columns, name and year) using what the user has input (variable newName and …
Tag: sql
Adding a computed column that uses MAX
I need to create a sequential number column for record number proposes I am OK with losing sequence if I delete a row from the middle of the table For example 1 2 3 If I delete 2, I am ok with new …
How to generate the sequence number based on condition in sql server
I need to display a New Sequence column value based on the Score 1 or 0. MonthlyDate Score New Sequence ———– —— ———- 2019-08-01 1 0 2019-08-02 0 1 2019-08-03 0 …
SQL – how to limit query with LIKE to select a certain number of digits after the %?
I’m trying to parse model names from a table using LIKE. Each model value looks like new_model_01215, new_model_01557 etc. Where new_model_01 part will be the same for all values. And there will …
How to redesign the table? Like recursive CTE
Due to the limited support of Bigquery for recursive CTE, I only have to use some silly ways to deal with the problem. My question is that I have a table below: Employee0 Employee1 Employee2 …
Populate data to tables as per daterange
I have a table in Oracle: select * from leave; –LEAVE_DTL_ID is auto incremented LEAVE_DTL_ID STAFF_ID START_DT END_DT ———— ———- ——— -…
mysql workbench No database selected Select the default DB to be used by double-clicking its name in the SCHEMAS list in the sidebar
I’m learn sql for web design. I am using MySql WorkBench, as stated in the title I’m wondering if there something in sql code is missing. Given error: 14:59:45 CREATE TABLE branch ( branch_id int(…
How to use RegEx in the SQL function CHARINDEX to find the nth occurrence
The intent of the following algorithm is to extract certain set of fields from a key (in this example, extract first 2 fields), and it works. The fields are delimited by a colon: Result: Field-1:Field-2 Microsoft document says that the first parameter is an expression, but I think what they mean by that in th…
how to get data from different levels in a xmltable?
I’m trying to get the values of two attributes from table MVR_DTL in column VENDOR_XML. VENDOR_XML is of datatype clob and contains an xml that looks like this <Routing …
MS Access – string to date
I have a column Date with this format: 2019-07-01T07:03:05.612289+02:00 And I need chage thit final form yyyy-mm-ss (in this example 2019-07-01) Unfortunately this code does nothing: SELECT Format (…