Skip to content

Tag: mysql

Can i use SUBSTR() inside of CAST() method?

I have a table called cities, with a column for timezones ( Timezone VARCHAR(10) NOT NULL that has timezones stored like: +00:00 or -02:00). – I am trying to select all cities that are two hours behind a city belonging to the +02:00 timezone. I want to select the third character of the string and conver…

How to bring columns to a table from another table by the Id?

I have this tables People, Ticket, and Report. I would like to replace the ForeingKey idPeople with columns Name and Age from People table. In the Report table replace the Foreing Key idTicket with ticketCol2, Name, Age from the previous table Ticket with replaced columns (idPeople by Name, Age). And I the re…