Category "sql"

SQLITE PIVOT TABLE WITH COUNT

Can you help me plase ? I want a result like the table below with Sqlite . task_name status_code department 1 A START PUR 2 B START ENG 3 C FINISH ENG 4 D NOT

Trouble with formatting date prompt in Cognos Report Studio Version 10.2.1

I'm having trouble with an error that says: UDA-SQL-0144 An arithmetic exception was detected.[IBM][CLI Driver][DB2/NT64] SQL20448N "1993" cannot be interprete

Impala - Check if a string is a number

Is there any way to check if a string is a number in Impala? like is_numeric is SQL?

Group by age ranges in MySQL

We have a date of birth field(type date) and user_id in the table and we want to get count of users group by age based on the date of birth field For e.g. afte

want to get country area code from phone number present in mysql db

I'm having phone number 1212010089 and want to know from which country I'm getting this number.I do have a table_1 which is having column1 area_codewhere lots o

ORA-01410 - Invalid ROWID while trying to UPDATE/DELETE in Oracle APEX

I'm currently creating an app in Oracle APEX and for some unknown to me reason while trying perform UPDATE/DELETE action by clicking on 'edit' button in the rep

Group by age ranges in MySQL

We have a date of birth field(type date) and user_id in the table and we want to get count of users group by age based on the date of birth field For e.g. afte

Relacing a word in an db2 sql file causes DSNC105I : End of file reached while reading the command error

I have a dynamic sql file in which name of TBCREATOR changes as given in a parameter. I use a simple python script to change the TBCREATOR=<variable here>

union all in SQL (Postgres) mess the order

I have a query which is order by date , there is the query I have simplified it a bit but basically is : select * from (select start_date, to_char(end_date,

Get day number when all I have is day of the week

I was interested in MT0's answer on this question using intervals and dates. I was working through trying to find a different way to answer the question and I s

How To Run A Github Repository?

I'm a coding newbie, so this may be sort of a dumb question. I was working on an SQL project to learn the language and I wanted to know if there was a way to do

Rails SQL "select in" across several columns: where (code1, code2) in (("A", 1), ("A", 3), ("Q", 9))

I have a business requirement to select records based on two fields in one table: code1 and code2. The selection is complex and hard-coded, with no codeable rhy

Using CASE statement to INSERT values into multiple columns in SQLite

I'm trying to use INSERT statement to add values to a few columns in a new table depending on the value of a column in another table. I'm writing in SQLite. I w

Converting VARCHAR with divide operand to INT

I have a VARCHAR which will return the value something like this '40/4'. Is there a way to convert this VARCHAR to an INT? I tried casting but it is not working

How do I define a variable based on a Case statement or If statement in the middle of SELECT statement?

I am defining the prefix of an address and then trying to remove it from the address. How can I define a variable using an if statement or case statement in the

Parameter name is changed in bin_params using JinjaSql

Imagine this is my query : query = ''' SELECT * FROM table WHERE id = {{myid}}''' params = {'myid':3} j= JinJaSql(param_style='pyformat

How can we use group by keyword on PIVOT table having dynamic column joined with another table or alternative query of Pivot

I have 2 tables named tblDemo and tblSubDemo; tblDemo havve 2 columns _id and _name. tblSubDemo have 3columns, ID,Name, Demo_ID(it is the primary key of tblDemo

node-mssql Transaction insert - Returning the inserted id..?

I'm using node-mssql 3.2.0 and I need to INSERT INTO a table and return the id of the inserted record. I can successfully use sql.Transaction() to insert data,

Give a radio button a hidden text value through selecting an image that is stored with that name in the database PHP/Html

Hello infinitely more knowledgeable stack overflow community. I am trying to accomplish the following: There is this quick form a user fills out and part of tha

How to get ROW_NUMBER() in SQL?

I tried to get the row number using ROW_NUMBER() but it shows the following error: can't format message 13:896 -- message file C:\WINDOWS\firebird.msg not