Ask me a question about MSSQL query statements

Updated on society 2024-04-14
4 answers
  1. Anonymous users2024-02-07

    from Inpatient Description Form inner join Inpatient Information Form on Inpatient Description Form. fname = Hospitalization Information Sheet. Fname Inner Join (select Fregistid from Hospitalization Registration Form Group by FregistID) c on Hospitalization Information Form.

    fkeyid=

  2. Anonymous users2024-02-06

    Supplement: select other fields to be queried in the 3 tables, distinct hospitalization information table. FKEYID, distinct Hospitalization Registration Form.

    fregistid from Inpatient Description Form, Inpatient Information Form, Inpatient Registration Form where Inpatient Description Form. fname = Hospitalization Information Sheet. fname and(or) Hospitalization Information Sheet.

    FKEYID = Hospitalization Registration Form. fregistid

    Note: 'Other fields to be queried in the 3 tables' can be written according to your needs, and the format is 'table'. field'. If the two conditions of where need to be met at the same time, use AND if either of them is satisfied, you can use OR

  3. Anonymous users2024-02-05

    Select Max (Hospitalization Registration Form), Description, Information, Registration.

    from Inpatient Description Form.

    Inner Join Hospitalization Information Form on Inpatient Description Form. fname = Hospitalization Information Sheet. fname

    Inner Join Hospitalization Registration Form on Hospitalization Information Form. FKEYID = Hospitalization Registration Form. fregistid

    group by description, info, registration.

    Registration has a registration date.

    According to this sql, it would be good to change the fields by yourself max (hospitalization registration form), and the fields at the back are written to group by and you can use it.

  4. Anonymous users2024-02-04

    select top 1 from (Table 1 inner join, Table 2 on Table 1.)Field number = Table 2field number) inner join table 3 on table 1Field Number = Table 3Field number.

    The following is the value and time value of the name field and the value of the query.

    That is, if there are multiple duplicate names, only one name should be taken.

    select distinct(name),min(time) as time from table group by name

    Let's put it together myself, try it out, I don't know much, so I'll have to give me an idea.

Related questions
9 answers2024-04-14

Phew"It's a very Chinese character.,So the general five-stroke input method can't be typed.。 According to the five-stroke encoding rule, it should be kyth >>>More

15 answers2024-04-14

This question, depending on what kind of mentality you have! >>>More

16 answers2024-04-14

stuff deletes characters of the specified length and inserts another set of characters at the specified starting point. >>>More

11 answers2024-04-14

When x->0, x and sinx are equivalent infinitesimal quantities, so replacing all x's with sinx gives : >>>More

10 answers2024-04-14

The friction force multiplied by the displacement of the plank below is equal to the change in kinetic energy of the plank below; >>>More