I notice that I am a beginner and may be asked something simple, but come on. I have two tables, PROMOTIONAL and PRODUCTS, where a PRODUCT can relate to zero or many PROMOTIONAL records. What I need is, when I make a select in product, I also b...
Good afternoon
I have the following database structure:
Tables:
-User
-Group
- Permission
And all relations N to N:
User Group
User Permission
PermissionGroup
I made a query to return the user, regardless...
I'm having trouble building an sql that returns the sum of the entries and the sum of the outputs correctly. I have tables tbl_produtos(id_produto,NomeProduto) , tbl_entradas_produtos(Id_produto,QuantProdutos,Estoque,ExcluirProdutoEnt)...
I have the following entities:
@Entity
@Getter
@Setter
@NoArgsConstructor
@Table(schema = "MYDB", name = "TB_TESTE")
public class Teste implements Serializable {
@ManyToOne
@JoinColumn(name = "CO_TIPO_TESTE")
private TipoTeste tbT...
I'm not very knowledgeable in SQL programming and experience, however, I need to do a search on a PostrgeeSQL database (I'm using pgAdminIII) where I need to join two tables.
create table table_new as
select table.x1, table.x2, table.x3, tabl...
Hello,
In the following query, an error is encountered in the execution:
select
fto.id_taxon,
fto.cd_sexo as fto_cd_sexo,
fto.cd_idade as fto_idade,
x.ftv_cd_sexo,
x.ftv_cd_idade,
x.id_fv
from
tb_foto_oco...
[PROFESSORES]
id | nome |
1 | Gilson |
[CURSOS]
id | nome | professor_id
1 | Photoshop | 1
2 | AutoCad | 1
I would like the result of my SELECT to come in the format:
(Not necessarily or exactly the same, I just want to gro...
I have 3 tables as follows:
Intb_user,Ihavetwotypesofusers(buyer,seller)inanENUMfieldtodifferentiatetheusertype.IntheshoppingcartIhavetheuserIDs,product,andtransactionnumber.Ilink2timestotb_usuariotoknowwhoboughtandwhosold.IwanttoperformaS...
I have two tables, Cliente and Parcela .
The Parcela table has id do cliente as foreign key, a pagamento column that is null or contains the payment date in date format and a valor column th...
I have the following SELECT to select data from a table ( chat ) on a chat system:
SELECT * FROM (SELECT * FROM chat WHERE id_chat = '$chat_id' ORDER BY id DESC LIMIT 10) S WHERE id_chat = '$chat_id' ORDER BY id ASC LIMIT 10
Th...