Skip to content
Advertisement

Why use a JOIN clause versus a WHERE condition?

I develop against Oracle databases. When I need to manually write (not use an ORM like hibernate), I use a WHERE condition instead of a JOIN. for example (this is simplistic just to illustrate the style): I learned this style from an OLD oracle DBA. I have since learned that this is not standard SQL syntax. Other than being non-standard

Move SQL data from one table to another

I was wondering if it is possible to move all rows of data from one table to another, that match a certain query? For example, I need to move all table rows from Table1 to Table2 where their username …

How to order by maximum of two column which can be null in MySQL?

I want to do something like : maxof(Null,1000) should be 1000, How to implement the maxof? Answer If you know that salaryplus will always be greater than salaryminus, then you can do coalesce will return the first value which is not null, or (in this example) 0, if both values are null. Otherwise, do something like this: This will treat

How do I return the SQL data types from my query?

I’ve a SQL query that queries an enormous (as in, hundreds of views/tables with hard-to-read names like CMM-CPP-FAP-ADD) database that I don’t need nor want to understand. The result of this query needs to be stored in a staging table to feed a report. I need to create the staging table, but with hundreds of views/tables to dig through to

Advertisement