I struggled with this issue for too long before finally tracking down how to avoid/fix it. It seems like something that should be on StackOverflow for the benefit of others. I had an SSRS report where the query worked fine and displayed the string results I expected. However, when I tried to add that field to…
SQL query by adding two columns in where clause?
I have a database table that contains two scores: scoreA scoreB I am trying to make a SQL query by adding these two values, such as However, it shows an error: Is there any way to work around for this? P.S. the reason I don’t add a new column for scoreC is because scoreA/scoreB are updated continuously …
Querying association table object directly
I have to query the relationships directly, since I have to display them seperatly. task_user = db.Table( ‘pimpy_task_user’, db.Column(‘task_id’, db.Integer, db.ForeignKey(‘pimpy_task.id’)), …
Why isn’t SQLAlchemy creating serial columns?
SQLAlchemy is generating, but not enabling, sequences for columns in postgresql. I suspect I may be doing something wrong in engine setup. Using an example from the SQLAlchemy tutorial (http://docs.sqlalchemy.org/en/rel_0_9/orm/tutorial.html): With this script, the following table is generated: However, a seq…
Calculate Count of true bits in binary type with t-sql
I need to find how many true bit exists in my binary value. example: Answer Result:
SQL developer Import data wizard comes up blank
So I have a file that has over 100 entries in it as an excel worksheet. I want to put those over into a sql. So I fire up my sql developer and try and import the data but it doesn’t show up. The …
select NULL and false but not true in sql
i an new in vb.ner sql and what i am asking may be silly question. I have a table in sql server 2005 and a column name activated. this column contain NULL, true or false. I want to select only NULL …
Open and Close Cursors Inside or Outside a Transaction and How to Close a Cursor if a Transaction Fails
I am writing a stored procedure in SQL Server 2012 that uses a cursor for reading and a transaction inside a TRY CATCH block. Basically, my questions are as follows: Should I declare my cursor inside the TRY CATCH block? If yes, should I declare the cursor before or after the BEGIN TRANSACTION statement? Shou…
How to check if a table exists in Hive?
I am connecting to Hive via an ODBC driver from a .NET application. Is there a query to determine if a table already exists? For example, in MSSQL you can query the INFORMATION_SCHEMA table and in …
How would I use excel to generate a large update sql statement?
I know there’s a way to have insert statements within excel. Is there one for update? so far I’ve managed to come up with my update statement in SQL, but I have 6000 rows to update: = “Update table …