What does .* (dot star) mean in SQL?

Viewed 1578

What does the .* mean in SQL?

I saw it in this query:

SELECT 
  socialmedia_kat_stundenvorlagen.*,
  socialmedia_zielgruppen.ziel_benutzer,
  socialmedia_zielgruppen.ziel_benutzergruppe,
  socialmedia_zielgruppen.ziel_dashboardgruppe
FROM 
  socialmedia_kat_stundenvorlagen 
  INNER JOIN socialmedia_zielgruppen 
    ON socialmedia_zielgruppen.socialmedia_stunden_ID = socialmedia_kat_stundenvorlagen.ID
1 Answers

The * means "all columns".

Combined with the . and the prefix it means "all columns from the table/alias named".

So in your case

SELECT socialmedia_kat_stundenvorlagen.*

means "select all columns from the socialmeda_kat_stundenvorlagen table". You can do that so you get only the specific columns from that table, not all the columns from all the joined tables as well.

Related