小编Nik*_*hra的帖子

按条件查询获取第一行表

如何通过使用criteriaHQL查询获取表的第一行?

表创建脚本

   CREATE TABLE MonthlySubscriber(MSISDN bigint(20) 
   NOT NULL, MonthOfYear int(11) NOT NULL, 
   PRIMARY KEY (MSISDN)); 
Run Code Online (Sandbox Code Playgroud)

hibernate hql hibernate-criteria

9
推荐指数
1
解决办法
3万
查看次数

具有多个输入的 FormControlName 的 ControlValueAccessor

我想通过实现 ControlValueAccessor 创建自定义表单元素地址。

我正在尝试创建一个 AddressComponent,其中有多个输入字段。我想在像下面这样的反应形式中使用这个组件。

地址.component.html

<form name="form" class="form_main" #addForm="ngForm" (ngSubmit)="addForm.form.valid && saveAddress()" [formGroup]="addressForm">
  <!-- Address 1 -->
  <mat-form-field class="form-field">
    <input matInput placeholder="Address 1" formControlName="address1" required>
    <mat-error *ngIf="addressForm.get('address1').hasError('required')">
      *Required field
    </mat-error>
  </mat-form-field>

  <!-- Address 2 -->
  <mat-form-field class="form-field">
    <input matInput placeholder="Address 2" formControlName="address2">
  </mat-form-field>

  <!-- Address 3 -->
  <mat-form-field class="form-field">
    <input matInput placeholder="Address 3" formControlName="address3">
  </mat-form-field>

  <!-- Country -->
  <mat-form-field class="form-field">
    <input matInput placeholder="Country" formControlName="country" required>
    <mat-error *ngIf="addressForm.get('country').hasError('required')">
      *Required field
    </mat-error>
  </mat-form-field>

  <!-- State -->
  <mat-form-field class="form-field">
    <input matInput placeholder="State" …
Run Code Online (Sandbox Code Playgroud)

angular angular-reactive-forms

1
推荐指数
1
解决办法
1838
查看次数

根据列连接行的字符串

我哈瓦表

MsgID    Msg              value
ms001    I am here.       ----
ms001    Wher are you     dsdad
ms002    who r u          gfsdfdf
ms002    where is this    dadad
ms002    I am goin        adadad
Run Code Online (Sandbox Code Playgroud)

这可能是通过MySQL查询获得这样的结果

ms001    I am here. Wher are you
ms002    who r u wher is this I am goin  
Run Code Online (Sandbox Code Playgroud)

mysql

0
推荐指数
1
解决办法
76
查看次数