問題タブ [check-constraint]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
2 に答える
120 参照

sql - 挿入のためのSQLチェックデータ期間

datetime を含むテーブルがあり、挿入された値に対して +-30 分の期間に datetime を含むエントリがあるかどうかを確認したいと考えています。だから私はこの制約を書きます:

しかし、データを挿入しようとすると、このチェックでは挿入が許可されませんが、このスクリプトを実行すると、同じことが行われます:

期待される出力が得られます1

ここで何が間違っていますか?

0 投票する
2 に答える
47 参照

mysql - MySQL Create Table That Accept Check values That Starts With

I created a table for my cellphone contacts and I want to sort the cellphone numbers. Example if the phone number starts with 1 to 3 it belongs to the first telecommunications company and 4 to 6 belongs to other.

What I want to do is if the user enters their phone number the number will be inserted to the table of the telecom company but each telecom company is dependent on the ContactId which is the primary key in cellphoneContacts table.

I already tried using cellnum1 but nothing works

0 投票する
1 に答える
167 参照

arrays - テーブル内の varchar[] および varchar[][] 列の制約を確認する

単語ゲームの場合、配列にCHECK制約を追加しようとしています:VARCHAR

しかし、構文エラーが発生します:

おそらく、ALLキーワードが右側にあるはずだからですか?

ここでチェック制約を実装する方法を誰かに勧めてもらえますか?

0 投票する
1 に答える
256 参照

sql - SQL DDL - 2 CHECK Constraints on 1 Attribute

Below is DDL for the table I want to create. However, I want the attribute 'Appointment_datetime' to be a future date and during working hours (between 8:00AM and 5:00PM). I can get the future date part with -'CHECK (Appointment_datetime >= GETDATE()) But how do I get between 8AM and 5PM ontop of this constraint?

0 投票する
1 に答える
87 参照

postgresql - PropelORM+PostgreSQL: 'schema.xml' の列に SQL のような CHECK 制約を定義するにはどうすればよいですか?

「schema.xml」ファイルで定義しようとしているデータベース スキーマの小さなスニペット:

その「価格」列についてPostgreSQLで書いたはずですCHECK (price > 0::numeric)が、ここでこれを達成する方法が見つからないようです。ドキュメントを確認しました(http://propelorm.org/documentation/reference/schema. html ) ですが、これについては何も見つかりませんでした。ありがとうございました。

0 投票する
1 に答える
117 参照

sqlite - 最初の sqlite.net コード: チェック制約を追加する

sqlite データベースとコード ファースト アプローチが与えられた場合、チェック制約をテーブルに追加するにはどうすればよいですか? 私はSQLを使用できないので、属性があるので、使用できます[PrimaryKey]か?

私は何かを望んでいます

実際、私が本当に望んでいるのは、最大で 1 つの行を含むことができるようにテーブルを制約することです。これを達成する他の方法があれば、私も幸せです。

これを行う方法はありますか?

たくさんのご挨拶!

フォルカー