Skip to content

Tag: sql

RIGHT OUTER JOIN in SQLAlchemy

I have two tables beard and moustache defined below: I have created a SQL Query in PostgreSQL which will combine these two tables and generate following result: Query: However I can not create SQLAlchemy representation of it. I tried several ways from implementing from_statement to outerjoin but none of them …

How to fill Dataset with multiple tables?

I’m trying to fill DataSet which contains 2 tables with one to many relationship. I’m using DataReader to achieve this : But I’ve got only one table filled up. How do I achieve my goal – fill both tables? I would like to use DataReader instead DataAdapter, if it possible. Answer If you…

Can I parameterize the table name in a prepared statement?

I’ve used the mysqli_stmt_bind_param function several times. However, if I separate variables that I’m trying to protect against SQL injection I run into errors. Here’s some code sample: Is it possible to somehow replace the .$new_table. concatenation with another question mark statement, ma…

SQL performance MAX()

Just got a small question. When trying to get a single max-Value of a table. Which one is better? or I’m using Microsoft SQL Server 2012 Answer There will be no difference as you can test yourself by inspecting the execution plans. If id is the clustered index, you should see an ordered clustered index …