Skip to content
Advertisement

Tag: select

mysql get result from join table

I have a tables person and exam. I want to show data where all exam is PASS, show the latest exam pass_date. like table below what query to get it? please help. thanks! Answer You can use aggregation and conditional expressions: Note that for this sample data, you don’t need to bring in the person table to get the results

How to use select statements for column name ending in +

I am attempting to run a spearman correlation on some data under the column name solar+. However, when attempting to use select statements to select the desired number of rows from the egauge13830 table, the plus sign is considered an operator and causes an error. These are the 2 statements I’ve tried and their results: 1) sqlalchemy.exc.ProgrammingError: (psycopg2.errors.SyntaxError) syntax error

select current address

I am new in sql and have a table as folow: patientid |gender|yearbirth|zipcode|admission | ———–|——|———|——-|——————-| P1213060727|w | 1926|55268 |2017-01-23 16:28:00| P1213060727|w | 1926|55270 |2018-09-26 18:10:00| P1213060729|w | 1956|55262 |2018-03-09 09:51:00| P1213060731|m | 1935|55276 |2015-02-11 16:54:00| P1213060762|w | 1945|55452 |2011-01-19 15:30:00| Some person have two address and I need the list of patients with the current address. patientid |gender|yearbirth|zipcode| ———–|——|———|——-| P1213060727|w

SQL query NOT EXIST very slow

I’m trying to optimize an SQL query as it is slow, and gets slower when the query result is high. There are indexes concerned fields and Tables are quite big. Answer As a starter, this condition: Should be rewritten as: This is functionally equivalent, and not using date functions on the column being filtered gives the database a chance to

Select field based on other column max value in oracle pl/sql

I am calculating a field called “Degree Level” in a view. This is a field in the table “Degrees”, and the table shows degrees for each faculty member. A faculty member can have more than one degree. The field “degree level” is also in the table “Crosswalk_Table”. I want to choose Degree level for a faculty member based on the

Advertisement