Skip to content

Tag: sql

Two Inner Joins MYSQL

How would I preform two inner joins in one query? Ie: three tables Invoice Address Client Invoice has a column which references an id in clients. It also has a column which references an address. I need to get both the clients name from the matched table and the address from the matched table. How would I INN…

SQL Server VARBINARY(max) to c# byte[]

I am querying the table (one of the columns is a VARBINARY(MAX)) which returns some records. Then I save that as .dat.csv then I parse through that .dat file and get that varbinary value into a string by splitting the file based on commas. Now I need to convert this varbinary to byte array. How can I do that?…

How to use money data type in Java, SQL, ORM

What are best practises in using money data type in Java application? Money should be in double variable? What about rounding, currencies and so on. Are special libraries for this? And what about ORM and SQL in most popular databases. As I know not in all SQL engines is Money data type. In that case NUMERIC(1…

Conditional NOT NULL case SQL

I am trying to calculate a field and I want it to behave differently depending on if one of the columns happens to be null. I am using MySQL Is this the right syntax? Answer You need to have when reply.replies IS NOT NULL NULL is a special case in SQL and cannot be compared with = or <> operators.