Hello i am still learning and i faced this problem,please how can i fix it ? A symbol name was expected! (near “id” ) At least one column definition was expected. (near “id” ) Unexpected …
Cannot create new procedure in SQL manager lite
I am working with SQL manager lite for Interbase/Firebird application. I have downloaded firebird database, successfully connected to that database and its host, but now I want to create procedure. I couldn’t done it via tutorials, so I decided to just click New->Procedure and do that automatically. …
SQL How to link lowest row from another select
I searching since a week for this problem. I try many code and I’m not able to get a correct answer, here’s the problem : I have a table of seller that have each time a customer contact this seller, …
SQL: Combining LIKE and IN in SQL , and Showing the Array of LIKE in a column
Below code works to combine Like and IN. But I need a column in the output with the values that I used for the Like: SELECT file_id FROM table1 as t WHERE archival_date = ‘20180108’ WHERE EXISTS(…
SQL CASE WHEN (1=1) What is the 1=1 doing?
I have a SQL statement that I did not write and I am trying to get my head around it. CASE WHEN (1 = 1) THEN A.AMT WHEN (A.ACC_NO = ‘1’) THEN A.AMT – 100000000 WHEN (A.ACC_NO = ‘2’) THEN …
compare data between two tables and populate a flag column in 1st table with ‘Y’if exist else ‘N”
I have two tables, if data exist in 1st table then populate flag column with ‘Y’ if does not populate with ‘N’, I am comparing only 3 columns, one is number, 2nd is name and 3rd column is datetime. …
How do I match up what cost center an employee was in given the date of a work order when the employee changes cost centers?
I need to match up what cost center an employee was in given the date of a work order. The employee data is in a different table from the work order data. From the employee table, I have an employee …
Nested Assemblies Database Structure
I’m creating quoting software for the manufacturing business I work for and I’m unsure how to handle assemblies within my MySQL database structure as they are a little like a Russian Doll. Here’s a …
Serial number auto generation
Facing issue in auto generation of serial number. How can i use row_number() in proper manner or is there any alternative to achieve the expected results? Note: I want to write query without using CASE. Current Results: Expected Results: Answer You can try to use ROW_NUMBER window function in a subquery, then…
SQL comparing column changes the last X hours
I have a table containing log entries that looks like this: id | name | level | timestamp 5 | ironman | 35 | 2019-01-06 11:37:40 6 | ironman | 35 | 2019-01-06 11:38:40 7 | ironman |…